-
Notifications
You must be signed in to change notification settings - Fork 35
/
Linkedin.js
111 lines (96 loc) · 2.62 KB
/
Linkedin.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import React from 'react';
import { Trans } from '@lingui/macro';
import Grid from '@mui/material/Grid';
import Link from '@mui/material/Link';
import LinkedInIcon from '@mui/icons-material/LinkedIn';
import MenuItem from '@mui/material/MenuItem';
import Select from '../../../misc/Select';
import TextField from '@mui/material/TextField';
const id = 'linkedin';
const name = 'LinkedIn';
const version = '1.0';
const stream_key_link = '';
const description = (
<Trans>
Transmit to LinkedIn. More details can be found{' '}
<Link color="secondary" target="_blank" href="https://www.linkedin.com/help/linkedin/answer/128901/go-live-using-a-custom-stream-rtmp-">
here
</Link>
.
</Trans>
);
const image_copyright = <Trans>Please contact 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', 'mp3'],
video: ['h264'],
},
};
function ServiceIcon(props) {
return <LinkedInIcon alt="linkedin Logo" {...props} />;
}
function init(settings) {
const initSettings = {
protocol: 'rtmp://',
address: '',
...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.protocol + settings.address,
options: ['-f', 'flv'],
};
return output;
};
return (
<Grid container spacing={2}>
<Grid item xs={12} md={3}>
<Select type="select" label={<Trans>Protocol</Trans>} value={settings.protocol} onChange={handleChange('protocol')}>
<MenuItem value="rtmp://">rtmp://</MenuItem>
<MenuItem value="rtmps://">rtmps://</MenuItem>
</Select>
</Grid>
<Grid item xs={12} md={9}>
<TextField
variant="outlined"
fullWidth
label={<Trans>Address</Trans>}
value={settings.address}
onChange={handleChange('address')}
placeholder="{custom_id}.channel.media.azure.net:2935/live/{custom_id}"
/>
</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 };