mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 19:42:38 +02:00
parent
ecd67054fc
commit
da9411e231
7 changed files with 137 additions and 224 deletions
|
@ -189,7 +189,7 @@ $(document).ready(function () {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
$('.clearCacheFirstPageButton').on('click', function (ev) {
|
||||
ev.preventDefault();
|
||||
modal.showPleaseWait();
|
||||
|
@ -466,10 +466,45 @@ function nl2br(str, is_xhtml) {
|
|||
var breakTag = (is_xhtml || typeof is_xhtml === 'undefined') ? '<br />' : '<br>';
|
||||
return (str + '').replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + breakTag + '$2');
|
||||
}
|
||||
function inIframe () {
|
||||
function inIframe() {
|
||||
try {
|
||||
return window.self !== window.top;
|
||||
} catch (e) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
function playerPlay(currentTime) {
|
||||
if (typeof player === 'undefined') {
|
||||
if(currentTime){
|
||||
player.currentTime(currentTime);
|
||||
}
|
||||
try {
|
||||
var promise = player.play();
|
||||
|
||||
if (promise !== undefined) {
|
||||
promise.then(_ => {
|
||||
// Autoplay started!
|
||||
}).catch(error => {
|
||||
// Show something in the UI that the video is muted
|
||||
player.muted(true);
|
||||
player.play();
|
||||
});
|
||||
}
|
||||
} catch (e) {
|
||||
setTimeout(function () {
|
||||
var promise = player.play();
|
||||
|
||||
if (promise !== undefined) {
|
||||
promise.then(_ => {
|
||||
// Autoplay started!
|
||||
}).catch(error => {
|
||||
// Show something in the UI that the video is muted
|
||||
player.muted(true);
|
||||
player.play();
|
||||
});
|
||||
}
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue