-
- - - / cameras with two way audio support -
-
+ // Play audio
+ document.getElementById('play-send').addEventListener('click', ev => {
+ ev.preventDefault();
+ const action = document.querySelector('input[name="play"]:checked').value;
+ const url = new URL('api/ffmpeg', location.href);
+ url.searchParams.set('dst', src);
+ url.searchParams.set(action, document.getElementById('play-url').value);
+ fetch(url, {method: 'POST'});
+ });
- Play audio
- - - -- - - / cameras with two way audio support -
-
-
+ // Publish stream
+ document.getElementById('pub-send').addEventListener('click', ev => {
+ ev.preventDefault();
+ const url = new URL('api/streams', location.href);
+ url.searchParams.set('src', src);
+ url.searchParams.set('dst', document.getElementById('pub-url').value);
+ fetch(url, {method: 'POST'});
+ });
- Publish stream
-YouTube: rtmps://xxx.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx-xxxx -Telegram: rtmps://xxx-x.rtmp.t.me/s/xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxx- - - / Telegram RTMPS server -
-
-webrtc.html local WebRTC viewer
+ const share = document.getElementById('shareget');
+ share.href = `https://go2rtc.org/webtorrent/#${share.dataset.auth}&media=${media}`;
+ }
-
- share link
- copy link
- delete
- external WebRTC viewer
-
-
-
-WebRTC Magic
- - - - + // WebRTC functions + function webrtcLinksUpdate() { + const media = document.querySelector('input[name="webrtc"]:checked').value; + const direction = media.indexOf('video') >= 0 || media === 'audio' ? 'src' : 'dst'; + document.getElementById('local').href = `webrtc.html?${direction}=${src}&media=${media}`; --