mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
update
This commit is contained in:
parent
4ac03ccbda
commit
9dcf0278d3
5 changed files with 35 additions and 17 deletions
|
@ -4,7 +4,7 @@ global $global;
|
|||
<div style=" display: inline-grid;
|
||||
height: 100vh;
|
||||
width: 100vw;">
|
||||
<button class="btn btn-danger btn-lg btn-block h1" onclick="sendAVideoMobileLiveStreamerMessage('goLive', '1');" style="font-size: 32px;">
|
||||
<button class="btn btn-danger btn-lg btn-block h1" onclick="sendAVideoMobileMessage('goLive', '1');" style="font-size: 32px;">
|
||||
<i class="fas fa-broadcast-tower"></i> <?php echo __('Go Live'); ?>
|
||||
</button>
|
||||
<button class="btn btn-primary btn-lg btn-block h1" onclick="document.location = '<?php echo $global['webSiteRootURL']; ?>plugin/MobileManager/?logoff=1'" style="font-size: 32px;">
|
||||
|
@ -13,7 +13,7 @@ global $global;
|
|||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
sendAVideoMobileLiveStreamerMessage('loginJS', {site:"<?php echo $global['webSiteRootURL']; ?>", user:"<?php echo User::getUserName(); ?>", pass:"<?php echo User::getUserPass(); ?>"});
|
||||
//sendAVideoMobileLiveStreamerMessage('saveSessionUser', {site:"<?php echo $global['webSiteRootURL']; ?>", user:"<?php echo User::getUserName(); ?>", pass:"<?php echo User::getUserPass(); ?>"});
|
||||
sendAVideoMobileMessage('loginJS', {site:"<?php echo $global['webSiteRootURL']; ?>", user:"<?php echo User::getUserName(); ?>", pass:"<?php echo User::getUserPass(); ?>"});
|
||||
//sendAVideoMobileMessage('saveSessionUser', {site:"<?php echo $global['webSiteRootURL']; ?>", user:"<?php echo User::getUserName(); ?>", pass:"<?php echo User::getUserPass(); ?>"});
|
||||
});
|
||||
</script>
|
|
@ -641,6 +641,23 @@ class PlayerSkins extends PluginAbstract {
|
|||
player.on('play', function () {
|
||||
addView({$videos_id}, this.currentTime());
|
||||
_addViewBeaconAdded = false;
|
||||
sendAVideoMobileMessage('play', this.currentTime());
|
||||
});
|
||||
player.on('ended', function () {
|
||||
var time = Math.round(this.currentTime());
|
||||
addView({$videos_id}, time);
|
||||
sendAVideoMobileMessage('ended', time);
|
||||
});
|
||||
player.on('pause', function () {
|
||||
var time = Math.round(this.currentTime());
|
||||
addView({$videos_id}, time);
|
||||
sendAVideoMobileMessage('pause', time);
|
||||
});
|
||||
player.on('volumechange', function () {
|
||||
sendAVideoMobileMessage('volumechange', player.volume());
|
||||
});
|
||||
player.on('ratechange', function () {
|
||||
sendAVideoMobileMessage('ratechange', player.playbackRate);
|
||||
});
|
||||
player.on('timeupdate', function () {
|
||||
var time = Math.round(this.currentTime());
|
||||
|
@ -658,10 +675,7 @@ class PlayerSkins extends PluginAbstract {
|
|||
addViewFromCookie();
|
||||
addViewSetCookie(PHPSESSID, {$videos_id}, time, seconds_watching_video);
|
||||
}
|
||||
});
|
||||
player.on('ended', function () {
|
||||
var time = Math.round(this.currentTime());
|
||||
addView({$videos_id}, time);
|
||||
sendAVideoMobileMessage('timeupdate', time);
|
||||
});";
|
||||
|
||||
if (!empty($nextURL)) {
|
||||
|
|
|
@ -3826,28 +3826,32 @@ function addScript(src) {
|
|||
}
|
||||
|
||||
function avideoLogoff(redirect) {
|
||||
sendAVideoMobileLiveStreamerMessage('logoff', '');
|
||||
sendAVideoMobileMessage('logoff', '');
|
||||
if (redirect) {
|
||||
document.location = webSiteRootURL + 'logoff';
|
||||
}
|
||||
}
|
||||
|
||||
async function sendAVideoMobileLiveStreamerMessage(type, value) {
|
||||
async function sendAVideoMobileMessage(type, value){
|
||||
return sendAVideoMobileMessage(type, value);
|
||||
}
|
||||
|
||||
async function sendAVideoMobileMessage(type, value) {
|
||||
if (typeof window.flutter_inappwebview !== 'undefined') {
|
||||
if (typeof window.flutter_inappwebview.callHandler == 'function') {
|
||||
for (i = 0; i < 10; i++) {
|
||||
response = await window.flutter_inappwebview.callHandler('AVideoMobileLiveStreamer' + i, {type: type, value: value, instanceIndex: i});
|
||||
if (response !== null) {
|
||||
console.log('sendAVideoMobileLiveStreamerMessage executed', i, response, type, value);
|
||||
console.log('sendAVideoMobileMessage executed', i, response, type, value);
|
||||
break;
|
||||
} else {
|
||||
console.log('sendAVideoMobileLiveStreamerMessage not found', i, type, value);
|
||||
console.log('sendAVideoMobileMessage not found', i, type, value);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
console.log('sendAVideoMobileLiveStreamerMessage will try again', type, value);
|
||||
console.log('sendAVideoMobileMessage will try again', type, value);
|
||||
setTimeout(function () {
|
||||
sendAVideoMobileLiveStreamerMessage(type, value);
|
||||
sendAVideoMobileMessage(type, value);
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
|
@ -3856,7 +3860,7 @@ async function sendAVideoMobileLiveStreamerMessage(type, value) {
|
|||
}
|
||||
}
|
||||
window.addEventListener("flutterInAppWebViewPlatformReady", function (event) {
|
||||
sendAVideoMobileLiveStreamerMessage('APPIsReady', 1);
|
||||
sendAVideoMobileMessage('APPIsReady', 1);
|
||||
});
|
||||
|
||||
function getUser() {
|
||||
|
|
|
@ -318,7 +318,7 @@ if (!empty($advancedCustomUser->forceLoginToBeTheEmail)) {
|
|||
url = addGetParam(url, 'PHPSESSID', response.PHPSESSID);
|
||||
}
|
||||
console.log('Login success', url);
|
||||
await sendAVideoMobileLiveStreamerMessage('saveSessionUser', {site:webSiteRootURL, user:$('#inputUser').val(), pass:$('#inputPassword').val()});
|
||||
await sendAVideoMobileMessage('saveSessionUser', {site:webSiteRootURL, user:$('#inputUser').val(), pass:$('#inputPassword').val()});
|
||||
document.location = url;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -192,7 +192,7 @@ getCSSAnimationClassAndStyleAddWait(0.5);
|
|||
if (!empty($redirectUri)) {
|
||||
if (isAVideoMobileApp()) {
|
||||
?>
|
||||
<button onclick="sendAVideoMobileLiveStreamerMessage('pop', {title:'', description:''});" class="btn btn-default btn-block btn-xs <?php echo getCSSAnimationClassAndStyle(); ?>" ><i class="fas fa-times"></i> <?php echo __("Cancel"); ?></button>
|
||||
<button onclick="sendAVideoMobileMessage('pop', {title:'', description:''});" class="btn btn-default btn-block btn-xs <?php echo getCSSAnimationClassAndStyle(); ?>" ><i class="fas fa-times"></i> <?php echo __("Cancel"); ?></button>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
|
@ -310,7 +310,7 @@ getCSSAnimationClassAndStyleAddWait(0.5);
|
|||
if (!response.error) {
|
||||
<?php
|
||||
if (isAVideoMobileApp()) {
|
||||
echo "sendAVideoMobileLiveStreamerMessage('pop', {title:'Success', description:''});";
|
||||
echo "sendAVideoMobileMessage('pop', {title:'Success', description:''});";
|
||||
} else {
|
||||
echo "window.location.href = '{$siteRedirectUri}';";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue