Fix login error + add dailymotion service

This commit is contained in:
Jan Stabenow 2023-11-28 19:54:09 +01:00
parent 729ad48cc4
commit 6f34336c32
5 changed files with 123 additions and 4 deletions

View File

@ -2,9 +2,8 @@
## v1.8.0 > v1.9.0
- Add kick.com publication service
- Add enlarged channel overview
- Add new publication services: Rumble, PicartoTV, NimoTV, Livepush
- Add new publication services: Dailymotion, Livepush, kick.com, NimoTV, PicartoTV, Rumble
- Add frame interpolation (framerate) filter (thanks to orryverducci)
- Add -referer option for pulling HTTP streams ([PR 40](https://github.com/datarhei/restreamer-ui/pull/40), thanks to mdastgheib)
- Add a/v filter to the publication components ([#593](https://github.com/datarhei/restreamer-ui/issues/593))

View File

@ -1,7 +1,7 @@
import { i18n } from '@lingui/core';
import { t } from '@lingui/macro';
import { v4 as uuidv4 } from 'uuid';
import * as jwt_decode from 'jwt-decode';
import { jwtDecode } from "jwt-decode";
import Handlebars from 'handlebars/dist/cjs/handlebars';
import SemverSatisfies from 'semver/functions/satisfies';
import SemverGt from 'semver/functions/gt';
@ -403,7 +403,7 @@ class Restreamer {
} else {
let claims = null;
try {
claims = jwt_decode(token);
claims = jwtDecode(token);
this._setTokenRefresh(claims.exi);
this.api.SetToken(token);
} catch (e) {

View File

@ -0,0 +1,115 @@
import React from 'react';
import { Trans } from '@lingui/macro';
import Grid from '@mui/material/Grid';
import Link from '@mui/material/Link';
import TextField from '@mui/material/TextField';
import Logo from './logos/dailymotion.svg';
const id = 'dailymotion';
const name = 'Dailymotion';
const version = '1.0';
const stream_key_link = '';
const description = (
<Trans>
Transmit your Livestream to an Dailymotion RTMP service.{' '}
<Link color="secondary" target="_blank" href="https://faq.dailymotion.com/hc/en-us/articles/115009103088-Create-and-configure-a-live-stream">
Here{' '}
</Link>
you can find more details about the settings.
</Trans>
);
const image_copyright = <Trans>Please get in touch with the operator of the service and check what happens.</Trans>;
const author = {
creator: {
name: 'datarhei',
link: 'https://github.com/datarhei',
},
maintainer: {
name: 'datarhei',
link: 'https://github.com/datarhei',
},
};
const category = 'platform';
const requires = {
protocols: ['rtmp', 'rtmps'],
formats: ['flv'],
codecs: {
audio: ['aac'],
video: ['h264'],
},
};
function ServiceIcon(props) {
return <img src={Logo} alt="Dailymotion Logo" {...props} />;
}
function init(settings) {
const initSettings = {
server_url: '',
stream_key: '',
...settings,
};
return initSettings;
}
function Service(props) {
const settings = init(props.settings);
const handleChange = (what) => (event) => {
const value = event.target.value;
settings[what] = value;
const output = createOutput(settings);
props.onChange([output], settings);
};
const createOutput = (settings) => {
const output = {
address: settings.server_url,
options: ['-rtmp_playpath', settings.stream_key, '-f', 'flv'],
};
return output;
};
return (
<Grid container spacing={2}>
<Grid item xs={12}>
<TextField
variant="outlined"
fullWidth
label={<Trans>Stream URL</Trans>}
value={settings.server_url}
onChange={handleChange('server_url')}
error={settings.server_url.includes('rtmp://') || settings.server_url.includes('rtmps://') ? false : true}
helperText={settings.server_url.includes('rtmp://') || settings.server_url.includes('rtmps://') ? false : 'Please enter a valid RTMP/S URL.'}
/>
</Grid>
<Grid item xs={12} md={9}>
<TextField
variant="outlined"
fullWidth
placeholder="abc123"
label={<Trans>Stream key</Trans>}
value={settings.stream_key}
onChange={handleChange('stream_key')}
/>
</Grid>
</Grid>
);
}
Service.defaultProps = {
settings: {},
skills: {},
metadata: {},
streams: [],
onChange: function (output, settings) {},
};
export { id, name, version, stream_key_link, description, image_copyright, author, category, requires, ServiceIcon as icon, Service as component };

View File

@ -4,6 +4,7 @@ import * as Brightcove from './Brightcove';
import * as CDN77 from './CDN77';
import * as Core from './Core';
import * as DaCast from './DaCast';
import * as Dailymotion from './Dailymotion';
import * as DASH from './DASH';
import * as DLive from './DLive';
import * as Facebook from './Facebook';
@ -94,6 +95,7 @@ registry.Register(Azure);
registry.Register(Brightcove);
registry.Register(Akamai);
registry.Register(DaCast);
registry.Register(Dailymotion);
registry.Register(Livepush);
registry.Register(Rumble);
registry.Register(CDN77);

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" baseProfile="tiny" overflow="visible" version="1.2" viewBox="0 0 90.1 100">
<path fill="white" d="M89 40.3C84.2 16.6 63.5 0 39.2 0H3.3C.9 0 0 .9 0 3.3v14.1c0 1.3.4 2.2 1.3 3.1 5.5 5.4 11 10.9 16.6 16.3.6.6 1.8 1 2.7 1 5.7.1 11.4 0 17.2.1 1.1 0 2.1.1 3.2.2 7.6.9 12.5 9 9.7 16.1-2 5-6.3 7.9-12.1 7.9H12.3c-3.1 0-3.7.6-3.7 3.8v13.8c0 1.1.3 2 1.1 2.8 5.6 5.5 11.1 11 16.7 16.4.5.5 1.4 1 2.1 1 5.6 0 11.2.2 16.7-.4 12.5-1.4 23.3-6.7 31.7-16.1C88 71.1 92.3 56.6 89 40.3zM17.4 24.8c-.2 1.3 0 2.7 0 4.4-1.5-1.4-2.8-2.6-4-3.9l-7.5-7.5c-.4-.4-.7-1-.7-1.5-.1-2.6 0-5.1 0-8.1 3.1 2.9 5.7 5.7 8.8 8.1 2.8 2.3 3.9 5 3.4 8.5zm8.4 66.4c-.4-.3-.7-.5-.9-.7-3.6-3.5-7.2-7.1-10.7-10.6-.3-.3-.6-.8-.6-1.2-.1-2.7 0-5.3 0-8.3 4.1 3.9 8 7.5 11.8 11.1.2.2.4.5.4.7v9zm3.3-13.3C25.4 74.5 21.7 71 18 67.5c0-.1.1-.2.1-.3h20.7c8.6-.1 15.5-5.5 17.3-13.5 2.2-9.5-4.6-19.4-14.3-20.4-5-.5-10.1-.3-15.1-.3h-4V22c.3 0 .6-.1.9-.1 5.6 0 11.1-.1 16.7 0 13.1.2 25 10.5 27.1 23.4 2.8 17.3-10.1 32.7-27.6 33-3.1.1-6.2 0-9.3 0-.5-.1-1.1-.2-1.4-.4zm31.4 11.9c-7 3.5-14.3 5.2-22.1 5.2H31V83.2h1.8c4.7-.1 9.5.2 14.2-.9 13.2-3 23.4-13.9 25.5-27.3 2.8-17.4-9.3-34.5-26.7-37.6-3.2-.6-6.5-.6-9.8-.7-4.4-.1-8.8 0-13.2 0-.5 0-1.2-.1-1.6-.4-4-3.6-7.9-7.3-12.1-11.2.7 0 1.1-.1 1.5-.1h29.2c22.2.1 41.3 16.6 44.6 38.4 2.9 18.7-7 37.9-23.9 46.4z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB