diff --git a/plugin/Live/webRTC.js b/plugin/Live/webRTC.js index 64d25a067..1a9836693 100644 --- a/plugin/Live/webRTC.js +++ b/plugin/Live/webRTC.js @@ -1,86 +1,88 @@ window.addEventListener('message', event => { if (event.data.startLiveRestream) { startLiveRestream(event.data.m3u8, forceIndex); }else if (event.data.showPleaseWait) { modal.showPleaseWait(); }else if (event.data.hidePleaseWait) { modal.hidePleaseWait(); }else if (event.data.webRTCModalConfig) { console.log('event.data.webRTCModalConfig', event.data.webRTCModalConfig, typeof webRTCModalConfigShow); if(event.data.webRTCModalConfig==1){ if(typeof webRTCModalConfigShow =='function'){ webRTCModalConfigShow(); } }else{ if(typeof webRTCModalConfigHide =='function'){ webRTCModalConfigHide(); } } } }); function startLiveRestream(m3u8, forceIndex) { console.log('WebRTCLiveCam: startLiveRestream', m3u8, forceIndex); modal.showPleaseWait(); $.ajax({ url: webSiteRootURL + '/plugin/Live/webRTCToLive.json.php', method: 'POST', data: { 'm3u8': m3u8, 'live_servers_id': live_servers_id, - 'forceIndex': forceIndex + 'forceIndex': forceIndex, + 'user': webrtcUser, + 'pass': webrtcPass }, 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() { modal.showPleaseWait(); document.querySelector("iframe").contentWindow.postMessage({setLiveStart: 1}, "*"); webRTCPleaseWaitShow(); } function webRTCDisconnect() { document.querySelector("iframe").contentWindow.postMessage({setLiveStop: 1}, "*"); webRTCPleaseWaitHide(); } function webRTCConfiguration() { document.querySelector("iframe").contentWindow.postMessage({setConfiguration: 1}, "*"); } var _webRTCPleaseWaitShowTimeout; function webRTCPleaseWaitShow(){ $('body').addClass('webRTCPleaseWait'); clearTimeout(_webRTCPleaseWaitShowTimeout); _webRTCPleaseWaitShowTimeout = setTimeout(function(){ avideoToastError('Live error') webRTCPleaseWaitHide(); },60000); } function webRTCPleaseWaitHide(){ clearTimeout(_webRTCPleaseWaitShowTimeout); $('body').removeClass('webRTCPleaseWait'); } function webRTCisLive(){ $('body').addClass('webRTCisLive'); webRTCPleaseWaitHide(); } function webRTCisOffline(){ $('body').removeClass('webRTCisLive'); webRTCPleaseWaitHide(); } \ No newline at end of file diff --git a/plugin/Live/webcamFullscreen.php b/plugin/Live/webcamFullscreen.php index cfbd97cc8..07e9417a1 100644 --- a/plugin/Live/webcamFullscreen.php +++ b/plugin/Live/webcamFullscreen.php @@ -1,203 +1,205 @@ webRTC_player; $iframeURL = addQueryStringParameter($iframeURL, 'webSiteRootURL', $global['webSiteRootURL']); $iframeURL = addQueryStringParameter($iframeURL, 'userHash', Live::getUserHash(User::getId())); $chatURL = ''; $chat = AVideoPlugin::loadPluginIfEnabled('Chat2'); if (!empty($chat)) { $chatURL = Chat2::getChatRoomLink(User::getId(), 1, 1, 1, true, 1); if (!empty($_REQUEST['user'])) { $chatURL = addQueryStringParameter($chatURL, 'user', $_REQUEST['user']); } if (!empty($_REQUEST['pass'])) { $chatURL = addQueryStringParameter($chatURL, 'pass', $_REQUEST['pass']); } } $users_id = User::getId(); $trasnmition = LiveTransmition::createTransmitionIfNeed($users_id); $live_servers_id = Live::getCurrentLiveServersId(); $forceIndex = "Live" . date('YmdHis'); $liveStreamObject = new LiveStreamObject($trasnmition['key'], $live_servers_id, $forceIndex, 0); $streamName = $liveStreamObject->getKeyWithIndex($forceIndex, true); $controls = Live::getAllControlls($streamName); ?> <?php echo $config->getWebSiteTitle(); ?>