diff --git a/plugin/Live/meet.php b/plugin/Live/meet.php index 9fdb5a83f..e12b14375 100644 --- a/plugin/Live/meet.php +++ b/plugin/Live/meet.php @@ -1,238 +1,238 @@ ".__("The server is not ready").""; return ''; } if ($meetDomain == 'custom') { $domain = $objM->CUSTOM_JITSI_DOMAIN; } else { $domain = "{$meetDomain}?getRTMPLink=" . urlencode(Live::getRTMPLink(User::getId())); } $dropURL = "{$global['webSiteRootURL']}plugin/Live/droplive.json.php?live_transmition_id={$trasnmition['id']}&live_servers_id=" . Live::getCurrentLiveServersId(); ?>
\ No newline at end of file diff --git a/plugin/Live/webRTC.js b/plugin/Live/webRTC.js new file mode 100644 index 000000000..43062f67a --- /dev/null +++ b/plugin/Live/webRTC.js @@ -0,0 +1,37 @@ + +window.addEventListener('message', event => { + if (event.data.startLiveRestream) { + startLiveRestream(event.data.m3u8); + } +}); + +function startLiveRestream(m3u8) { + //console.log('WebRTCLiveCam: startLive'); + modal.showPleaseWait(); + $.ajax({ + url: webSiteRootURL + '/plugin/Live/webRTCToLive.json.php', + method: 'POST', + data: { + 'm3u8': m3u8, + 'live_servers_id': '' + }, + success: function (response) { + if (response.error) { + webRTCDisconnect(); + avideoAlertError(response.msg); + } else { + avideoToastSuccess(response.msg); + //document.querySelector("iframe").contentWindow.postMessage({setLiveStart: 1}, "*"); + } + modal.hidePleaseWait(); + } + }); +} + +function webRTCConnect() { + document.querySelector("iframe").contentWindow.postMessage({setLiveStart: 1}, "*"); +} + +function webRTCDisconnect() { + document.querySelector("iframe").contentWindow.postMessage({setLiveStop: 1}, "*"); +} \ No newline at end of file diff --git a/plugin/Live/webRTC.php b/plugin/Live/webRTC.php index 0733bb5b6..3f7fe2593 100644 --- a/plugin/Live/webRTC.php +++ b/plugin/Live/webRTC.php @@ -1,59 +1,62 @@ + +