1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-05 19:42:38 +02:00

Fix trailer

This commit is contained in:
Daniel 2022-02-25 16:30:41 -03:00
parent 4a35cdcb11
commit 8fe5a1a7e9

View file

@ -14,7 +14,6 @@ var mouseY;
var videoContainerDragged = false; var videoContainerDragged = false;
var youTubeMenuIsOpened = false; var youTubeMenuIsOpened = false;
var userIsControling = false; var userIsControling = false;
var _serverTime; var _serverTime;
var _serverDBTime; var _serverDBTime;
var _serverTimeString; var _serverTimeString;
@ -22,7 +21,6 @@ var _serverDBTimeString;
let deferredPrompt; let deferredPrompt;
var playerCurrentTime; var playerCurrentTime;
var mediaId; var mediaId;
$(document).mousemove(function (e) { $(document).mousemove(function (e) {
mouseX = e.pageX; mouseX = e.pageX;
mouseY = e.pageY; mouseY = e.pageY;
@ -147,7 +145,6 @@ function lazyImage() {
element.addClass('gifNotLoaded'); element.addClass('gifNotLoaded');
element.removeClass('blur'); element.removeClass('blur');
element.mouseover(function () { element.mouseover(function () {
if ($(this).hasClass('gifNotLoaded')) { if ($(this).hasClass('gifNotLoaded')) {
@ -171,7 +168,6 @@ function lazyImage() {
$("#log").append("<div>Handler for .mouseover() called.</div>"); $("#log").append("<div>Handler for .mouseover() called.</div>");
}); });
} }
}); });
mouseEffect(); mouseEffect();
@ -182,12 +178,10 @@ function lazyImage() {
} }
lazyImage(); lazyImage();
var pleaseWaitIsINUse = false; var pleaseWaitIsINUse = false;
var pauseIfIsPlayinAdsInterval; var pauseIfIsPlayinAdsInterval;
var seconds_watching_video = 0; var seconds_watching_video = 0;
var _startCountPlayingTime; var _startCountPlayingTime;
function setPlayerListners() { function setPlayerListners() {
if (typeof player !== 'undefined') { if (typeof player !== 'undefined') {
player.on('pause', function () { player.on('pause', function () {
@ -197,7 +191,6 @@ function setPlayerListners() {
clearInterval(pauseIfIsPlayinAdsInterval); clearInterval(pauseIfIsPlayinAdsInterval);
clearInterval(_startCountPlayingTime); clearInterval(_startCountPlayingTime);
}); });
player.on('play', function () { player.on('play', function () {
isTryingToPlay = false; isTryingToPlay = false;
clearTimeout(promisePlayTimeout); clearTimeout(promisePlayTimeout);
@ -217,7 +210,6 @@ function setPlayerListners() {
seconds_watching_video++; seconds_watching_video++;
}, 1000); }, 1000);
}); });
$("#mainVideo .vjs-mute-control").click(function () { $("#mainVideo .vjs-mute-control").click(function () {
Cookies.set('muted', player.muted(), { Cookies.set('muted', player.muted(), {
path: '/', path: '/',
@ -246,8 +238,8 @@ function changeVideoSrc(vid_obj, source) {
for (i = 0; i < source.length; i++) { for (i = 0; i < source.length; i++) {
if (source[i].type) { if (source[i].type) {
if (source[i].type === "application/x-mpegURL") { if (source[i].type === "application/x-mpegURL") {
// it is HLS cancel it // it is HLS cancel it
//return false; //return false;
autoLoad = false; autoLoad = false;
} }
srcs.push(source[i]); srcs.push(source[i]);
@ -257,7 +249,6 @@ function changeVideoSrc(vid_obj, source) {
} }
console.log('changeVideoSrc srcs', srcs); console.log('changeVideoSrc srcs', srcs);
vid_obj.src(srcs); vid_obj.src(srcs);
setTimeout(function () { setTimeout(function () {
if (autoLoad) { if (autoLoad) {
changeVideoSrcLoad(); changeVideoSrcLoad();
@ -265,7 +256,6 @@ function changeVideoSrc(vid_obj, source) {
player.play(); player.play();
} }
}, 1000); }, 1000);
return true; return true;
} }
@ -318,7 +308,6 @@ function reloadAds() {
player.ima.requestAds(); player.ima.requestAds();
} catch (e) { } catch (e) {
console.log('reloadAds ERROR', e.message); console.log('reloadAds ERROR', e.message);
} }
} else { } else {
_reloadAdsTimeout = setTimeout(function () { _reloadAdsTimeout = setTimeout(function () {
@ -460,9 +449,7 @@ function isMobile() {
var last_videos_id = 0; var last_videos_id = 0;
var last_currentTime = -1; var last_currentTime = -1;
var videoViewAdded = false; var videoViewAdded = false;
var addViewBeaconTimeout; var addViewBeaconTimeout;
function addView(videos_id, currentTime) { function addView(videos_id, currentTime) {
addViewSetCookie(PHPSESSID, videos_id, currentTime, seconds_watching_video); addViewSetCookie(PHPSESSID, videos_id, currentTime, seconds_watching_video);
if (last_videos_id == videos_id && last_currentTime == currentTime) { if (last_videos_id == videos_id && last_currentTime == currentTime) {
@ -544,7 +531,6 @@ function addViewFromCookie() {
var addView_videos_id = Cookies.get('addView_videos_id'); var addView_videos_id = Cookies.get('addView_videos_id');
var addView_playerCurrentTime = Cookies.get('addView_playerCurrentTime'); var addView_playerCurrentTime = Cookies.get('addView_playerCurrentTime');
var addView_seconds_watching_video = Cookies.get('addView_seconds_watching_video'); var addView_seconds_watching_video = Cookies.get('addView_seconds_watching_video');
if (!addView_PHPSESSID || addView_PHPSESSID === 'false' || if (!addView_PHPSESSID || addView_PHPSESSID === 'false' ||
!addView_videos_id || addView_videos_id === 'false' || !addView_videos_id || addView_videos_id === 'false' ||
!addView_playerCurrentTime || addView_playerCurrentTime === 'false' || !addView_playerCurrentTime || addView_playerCurrentTime === 'false' ||
@ -554,7 +540,6 @@ function addViewFromCookie() {
console.log('addViewFromCookie', addView_videos_id, addView_playerCurrentTime, addView_seconds_watching_video); console.log('addViewFromCookie', addView_videos_id, addView_playerCurrentTime, addView_seconds_watching_video);
var url = webSiteRootURL + 'objects/videoAddViewCount.json.php'; var url = webSiteRootURL + 'objects/videoAddViewCount.json.php';
url = addGetParam(url, 'PHPSESSID', addView_PHPSESSID); url = addGetParam(url, 'PHPSESSID', addView_PHPSESSID);
if (mediaId == addView_videos_id) { if (mediaId == addView_videos_id) {
// it is the same video, play at the last momment // it is the same video, play at the last momment
forceCurrentTime = addView_playerCurrentTime; forceCurrentTime = addView_playerCurrentTime;
@ -578,7 +563,7 @@ function addViewFromCookie() {
} }
function addViewSetCookie(PHPSESSID, videos_id, playerCurrentTime, seconds_watching_video) { function addViewSetCookie(PHPSESSID, videos_id, playerCurrentTime, seconds_watching_video) {
//console.log('addViewSetCookie', videos_id, playerCurrentTime, seconds_watching_video, new Error().stack); //console.log('addViewSetCookie', videos_id, playerCurrentTime, seconds_watching_video, new Error().stack);
Cookies.set('addView_PHPSESSID', PHPSESSID, { Cookies.set('addView_PHPSESSID', PHPSESSID, {
path: '/', path: '/',
expires: 1 expires: 1
@ -1103,14 +1088,14 @@ function isWebRTC() {
} }
function isAutoplayEnabled() { function isAutoplayEnabled() {
//console.log("Cookies.get('autoplay')", Cookies.get('autoplay')); //console.log("Cookies.get('autoplay')", Cookies.get('autoplay'));
if (typeof forceautoplay !== 'undefined' && forceautoplay) { if (typeof forceautoplay !== 'undefined' && forceautoplay) {
return true; return true;
} else if (isWebRTC()) { } else if (isWebRTC()) {
console.log("isAutoplayEnabled said No because is WebRTC "); console.log("isAutoplayEnabled said No because is WebRTC ");
return false; return false;
} else if (isALiveContent()) { } else if (isALiveContent()) {
//console.log("isAutoplayEnabled always autoplay live contents"); //console.log("isAutoplayEnabled always autoplay live contents");
return true; return true;
} else } else
if ($("#autoplay").length && $("#autoplay").is(':visible')) { if ($("#autoplay").length && $("#autoplay").is(':visible')) {
@ -1123,17 +1108,17 @@ function isAutoplayEnabled() {
typeof Cookies.get('autoplay') !== 'undefined' typeof Cookies.get('autoplay') !== 'undefined'
) { ) {
if (Cookies.get('autoplay') === 'true' || Cookies.get('autoplay') == true) { if (Cookies.get('autoplay') === 'true' || Cookies.get('autoplay') == true) {
//console.log("isAutoplayEnabled Cookie said Yes "); //console.log("isAutoplayEnabled Cookie said Yes ");
setAutoplay(true); setAutoplay(true);
return true; return true;
} else { } else {
//console.log("isAutoplayEnabled Cookie said No "); //console.log("isAutoplayEnabled Cookie said No ");
setAutoplay(false); setAutoplay(false);
return false; return false;
} }
} else { } else {
if (typeof autoplay !== 'undefined') { if (typeof autoplay !== 'undefined') {
//console.log("isAutoplayEnabled autoplay said " + ((autoplay) ? "Yes" : "No")); //console.log("isAutoplayEnabled autoplay said " + ((autoplay) ? "Yes" : "No"));
setAutoplay(autoplay); setAutoplay(autoplay);
return autoplay; return autoplay;
} }
@ -1381,7 +1366,9 @@ function avideoModalIframeWithClassName(url, className, updateURL) {
console.log('avideoModalIframeWithClassName content loaded 5'); console.log('avideoModalIframeWithClassName content loaded 5');
// is not loaded // is not loaded
url = addGetParam(url, 'avideoIframe', 0); url = addGetParam(url, 'avideoIframe', 0);
//document.location = url; if(isSameDomain(url)){
document.location = url;
}
} }
}, 5000); }, 5000);
} }
@ -1389,13 +1376,12 @@ function avideoModalIframeWithClassName(url, className, updateURL) {
} }
function checkIframeLoaded(id) { function checkIframeLoaded(id) {
// Get a handle to the iframe element // Get a handle to the iframe element
var iframe = document.getElementById(id); var iframe = document.getElementById(id);
var iframeDoc = iframe.contentDocument || iframe.contentWindow.document; var iframeDoc = iframe.contentDocument || iframe.contentWindow.document;
// Check if loading is complete // Check if loading is complete
if (iframeDoc.readyState == 'complete') { if (iframeDoc.readyState == 'complete') {
//iframe.contentWindow.alert("Hello"); //iframe.contentWindow.alert("Hello");
iframe.contentWindow.onload = function () { iframe.contentWindow.onload = function () {
alert("I am loaded"); alert("I am loaded");
}; };
@ -1404,7 +1390,7 @@ function checkIframeLoaded(id) {
return; return;
} }
// If we are here, it is not loaded. Set things up so we check the status again in 100 milliseconds // If we are here, it is not loaded. Set things up so we check the status again in 100 milliseconds
window.setTimeout(checkIframeLoaded, 100); window.setTimeout(checkIframeLoaded, 100);
} }
@ -1550,24 +1536,21 @@ function checkDescriptionArea() {
}); });
} }
$(document).ready(function () { $(document).ready(function () {
//animateChilds('#sideBarContainer > ul', 'animate__bounceInLeft', 0.05); //animateChilds('#sideBarContainer > ul', 'animate__bounceInLeft', 0.05);
//animateChilds('#uploadMenu', 'animate__bounceIn', 0.05); //animateChilds('#uploadMenu', 'animate__bounceIn', 0.05);
//animateChilds('#myNavbar > ul > li.dropdown > ul > div.btn-group.btn-group-justified', 'animate__bounceIn', 0.1); //animateChilds('#myNavbar > ul > li.dropdown > ul > div.btn-group.btn-group-justified', 'animate__bounceIn', 0.1);
//animateChilds('#lastItemOnMenu > div.navbar-header > ul > li > div > ul', 'animate__bounceInRight', 0.05); //animateChilds('#lastItemOnMenu > div.navbar-header > ul > li > div > ul', 'animate__bounceInRight', 0.05);
//animateChilds('.gallerySectionContent, .categoriesContainerItem .clearfix', 'animate__fadeInUp', 0.05); //animateChilds('.gallerySectionContent, .categoriesContainerItem .clearfix', 'animate__fadeInUp', 0.05);
//animateChilds('#videosList', 'animate__bounceInRight', 0.1); //animateChilds('#videosList', 'animate__bounceInRight', 0.1);
addViewFromCookie(); addViewFromCookie();
checkDescriptionArea(); checkDescriptionArea();
setInterval(function () {// check for the carousel setInterval(function () {// check for the carousel
checkDescriptionArea(); checkDescriptionArea();
}, 3000); }, 3000);
Cookies.set('timezone', Intl.DateTimeFormat().resolvedOptions().timeZone, { Cookies.set('timezone', Intl.DateTimeFormat().resolvedOptions().timeZone, {
path: '/', path: '/',
expires: 365 expires: 365
}); });
tabsCategoryDocumentHeight = $(document).height(); tabsCategoryDocumentHeight = $(document).height();
if (typeof $('.nav-tabs-horizontal').scrollingTabs == 'function') { if (typeof $('.nav-tabs-horizontal').scrollingTabs == 'function') {
$('.nav-tabs-horizontal').scrollingTabs(); $('.nav-tabs-horizontal').scrollingTabs();
@ -1580,7 +1563,6 @@ $(document).ready(function () {
} }
} }
}, 1000); }, 1000);
modal = modal || (function () { modal = modal || (function () {
var pleaseWaitDiv = $("#pleaseWaitDialog"); var pleaseWaitDiv = $("#pleaseWaitDialog");
if (pleaseWaitDiv.length === 0) { if (pleaseWaitDiv.length === 0) {
@ -1637,7 +1619,6 @@ $(document).ready(function () {
setInterval(function () { setInterval(function () {
setToolTips(); setToolTips();
}, 1000); }, 1000);
$(".thumbsImage").on("mouseenter", function () { $(".thumbsImage").on("mouseenter", function () {
gifId = $(this).find(".thumbsGIF").attr('id'); gifId = $(this).find(".thumbsGIF").attr('id');
$(".thumbsGIF").fadeOut(); $(".thumbsGIF").fadeOut();
@ -1657,9 +1638,7 @@ $(document).ready(function () {
$(".thumbsImage").on("mouseleave", function () { $(".thumbsImage").on("mouseleave", function () {
$(this).find(".thumbsGIF").stop(true, true).fadeOut(); $(this).find(".thumbsGIF").stop(true, true).fadeOut();
}); });
lazyImage(); lazyImage();
$("a").each(function () { $("a").each(function () {
var location = window.location.toString() var location = window.location.toString()
var res = location.split("?"); var res = location.split("?");
@ -1698,9 +1677,7 @@ $(document).ready(function () {
}); });
}); });
setPlayerListners(); setPlayerListners();
$('.duration:contains("00:00:00"), .duration:contains("EE:EE:EE")').hide(); $('.duration:contains("00:00:00"), .duration:contains("EE:EE:EE")').hide();
setInterval(function () { setInterval(function () {
if (typeof conn != 'undefined') { if (typeof conn != 'undefined') {
if (avideoSocketIsActive()) { if (avideoSocketIsActive()) {
@ -1711,7 +1688,6 @@ $(document).ready(function () {
} }
}, 1000); }, 1000);
$("input.saveCookie").each(function () { $("input.saveCookie").each(function () {
var mycookie = Cookies.get($(this).attr('name')); var mycookie = Cookies.get($(this).attr('name'));
if (mycookie && mycookie == "true") { if (mycookie && mycookie == "true") {
@ -1732,7 +1708,6 @@ $(document).ready(function () {
checkAutoPlay(); checkAutoPlay();
}); });
checkAutoPlay(); checkAutoPlay();
// Code to handle install prompt on desktop // Code to handle install prompt on desktop
window.addEventListener('beforeinstallprompt', (e) => { window.addEventListener('beforeinstallprompt', (e) => {
// Prevent Chrome 67 and earlier from automatically showing the prompt // Prevent Chrome 67 and earlier from automatically showing the prompt
@ -1753,7 +1728,6 @@ $(document).ready(function () {
}); });
}); });
}); });
function clearCache(showPleaseWait, FirstPage, sessionOnly) { function clearCache(showPleaseWait, FirstPage, sessionOnly) {
if (showPleaseWait) { if (showPleaseWait) {
modal.showPleaseWait(); modal.showPleaseWait();
@ -1795,7 +1769,6 @@ function startTimer(duration, selector, prepend) {
var hours = Math.floor((duration % (60 * 60 * 24)) / (60 * 60)); var hours = Math.floor((duration % (60 * 60 * 24)) / (60 * 60));
var minutes = Math.floor((duration % (60 * 60)) / (60)); var minutes = Math.floor((duration % (60 * 60)) / (60));
var seconds = Math.floor((duration % (60))); var seconds = Math.floor((duration % (60)));
// Display the result in the element with id="demo" // Display the result in the element with id="demo"
var text = ''; var text = '';
if (years) { if (years) {
@ -1837,7 +1810,6 @@ function startTimerTo(durationTo, selector) {
var hours = Math.floor((durationTo % (60 * 60 * 24)) / (60 * 60)); var hours = Math.floor((durationTo % (60 * 60 * 24)) / (60 * 60));
var minutes = Math.floor((durationTo % (60 * 60)) / (60)); var minutes = Math.floor((durationTo % (60 * 60)) / (60));
var seconds = Math.floor((durationTo % (60))); var seconds = Math.floor((durationTo % (60)));
// Display the result in the element with id="demo" // Display the result in the element with id="demo"
var text = ''; var text = '';
if (years) { if (years) {
@ -1857,7 +1829,6 @@ function startTimerTo(durationTo, selector) {
} }
$(selector).text(text); $(selector).text(text);
durationTo++; durationTo++;
}, 1000); }, 1000);
} }
@ -1919,7 +1890,6 @@ function getServerTime() {
} }
getServerTimeActive = 1; getServerTimeActive = 1;
var d = new Date(); var d = new Date();
$.ajax({ $.ajax({
url: webSiteRootURL + 'objects/getTimes.json.php', url: webSiteRootURL + 'objects/getTimes.json.php',
success: function (response) { success: function (response) {
@ -1946,7 +1916,6 @@ function clearServerTime() {
function addGetParam(_url, _key, _value) { function addGetParam(_url, _key, _value) {
var param = _key + '=' + escape(_value); var param = _key + '=' + escape(_value);
var sep = '&'; var sep = '&';
if (_url.indexOf('?') < 0) { if (_url.indexOf('?') < 0) {
sep = '?'; sep = '?';
@ -1958,7 +1927,6 @@ function addGetParam(_url, _key, _value) {
sep = ''; sep = '';
} }
_url += sep + param; _url += sep + param;
_url = removeDuplicatedGetParam(_url); _url = removeDuplicatedGetParam(_url);
return _url; return _url;
} }
@ -1974,7 +1942,6 @@ function removeDuplicatedGetParam(_url) {
var temp = params[i].split('='), var temp = params[i].split('='),
key = temp[0], key = temp[0],
val = temp[1]; val = temp[1];
results[key] = val; results[key] = val;
} }
@ -1989,14 +1956,12 @@ function removeDuplicatedGetParam(_url) {
function readFileCroppie(input, crop) { function readFileCroppie(input, crop) {
if ($(input)[0].files && $(input)[0].files[0]) { if ($(input)[0].files && $(input)[0].files[0]) {
var reader = new FileReader(); var reader = new FileReader();
reader.onload = function (e) { reader.onload = function (e) {
crop.croppie('bind', { crop.croppie('bind', {
url: e.target.result url: e.target.result
}).then(function () { }).then(function () {
console.log('jQuery bind complete'); console.log('jQuery bind complete');
}); });
} }
reader.readAsDataURL($(input)[0].files[0]); reader.readAsDataURL($(input)[0].files[0]);
@ -2014,7 +1979,6 @@ function getCroppie(uploadCropObject, callback, width, height) {
console.log('cropieError getCroppie => ' + callback, err); console.log('cropieError getCroppie => ' + callback, err);
eval(callback + "(null);"); eval(callback + "(null);");
}); });
console.log('getCroppie 3', ret); console.log('getCroppie 3', ret);
} }
@ -2117,7 +2081,7 @@ function isPlayerUserActive() {
} }
window.addEventListener('beforeunload', function (e) { window.addEventListener('beforeunload', function (e) {
//console.log('window.addEventListener(beforeunload'); //console.log('window.addEventListener(beforeunload');
_addViewAsync(); _addViewAsync();
}, false); }, false);
document.addEventListener('visibilitychange', function () { document.addEventListener('visibilitychange', function () {
@ -2125,7 +2089,6 @@ document.addEventListener('visibilitychange', function () {
_addViewAsync(); _addViewAsync();
} }
}); });
function socketClearSessionCache(json) { function socketClearSessionCache(json) {
console.log('socketClearSessionCache', json); console.log('socketClearSessionCache', json);
clearCache(false, 0, 1); clearCache(false, 0, 1);
@ -2190,7 +2153,6 @@ function downloadURLOrAlertError(jsonURL, data, filename) {
avideoToastInfo('Download start'); avideoToastInfo('Download start');
var loaded = 0; var loaded = 0;
var contentLength = 0; var contentLength = 0;
fetch(response.url) fetch(response.url)
.then(response => { .then(response => {
avideoToastSuccess('Download Start'); avideoToastSuccess('Download Start');
@ -2202,14 +2164,11 @@ function downloadURLOrAlertError(jsonURL, data, filename) {
const total = parseInt(contentLength, 10); const total = parseInt(contentLength, 10);
let loaded = 0; let loaded = 0;
return new Response( return new Response(
new ReadableStream({ new ReadableStream({
start(controller) { start(controller) {
const reader = response.body.getReader(); const reader = response.body.getReader();
read(); read();
function read() { function read() {
reader.read().then(({done, value}) => { reader.read().then(({done, value}) => {
if (done) { if (done) {
@ -2279,15 +2238,13 @@ function isVisibleAndInViewport(selector) {
if ($(selector).is(":visible")) { if ($(selector).is(":visible")) {
var elementTop = $(selector).offset().top; var elementTop = $(selector).offset().top;
var elementBottom = elementTop + $(selector).outerHeight(); var elementBottom = elementTop + $(selector).outerHeight();
var viewportTop = $(window).scrollTop(); var viewportTop = $(window).scrollTop();
var viewportBottom = viewportTop + $(window).height(); var viewportBottom = viewportTop + $(window).height();
return elementBottom > viewportTop && elementTop < viewportBottom; return elementBottom > viewportTop && elementTop < viewportBottom;
} else { } else {
return false; return false;
} }
} }
function playAudio(mp3) { function playAudio(mp3) {
console.log('pling start'); console.log('pling start');
@ -2309,7 +2266,6 @@ function playAudio(mp3) {
audio.autoplay = true; audio.autoplay = true;
audio.src = "data:audio/mpeg;base64,SUQzBAAAAAABEVRYWFgAAAAtAAADY29tbWVudABCaWdTb3VuZEJhbmsuY29tIC8gTGFTb25vdGhlcXVlLm9yZwBURU5DAAAAHQAAA1N3aXRjaCBQbHVzIMKpIE5DSCBTb2Z0d2FyZQBUSVQyAAAABgAAAzIyMzUAVFNTRQAAAA8AAANMYXZmNTcuODMuMTAwAAAAAAAAAAAAAAD/80DEAAAAA0gAAAAATEFNRTMuMTAwVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQsRbAAADSAAAAABVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQMSkAAADSAAAAABVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"; audio.src = "data:audio/mpeg;base64,SUQzBAAAAAABEVRYWFgAAAAtAAADY29tbWVudABCaWdTb3VuZEJhbmsuY29tIC8gTGFTb25vdGhlcXVlLm9yZwBURU5DAAAAHQAAA1N3aXRjaCBQbHVzIMKpIE5DSCBTb2Z0d2FyZQBUSVQyAAAABgAAAzIyMzUAVFNTRQAAAA8AAANMYXZmNTcuODMuMTAwAAAAAAAAAAAAAAD/80DEAAAAA0gAAAAATEFNRTMuMTAwVVVVVVVVVVVVVUxBTUUzLjEwMFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQsRbAAADSAAAAABVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/zQMSkAAADSAAAAABVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV";
audio.src = mp3; audio.src = mp3;
console.log('pling setTimeout', audio); console.log('pling setTimeout', audio);
const promise = audio.play(); const promise = audio.play();
if (promise !== undefined) { if (promise !== undefined) {
@ -2329,4 +2285,14 @@ function playAudio(mp3) {
}); });
} }
}, 500); }, 500);
}
function isSameDomain(url) {
var hrefURL, pageURL;
hrefURL = new URL(url);
pageURL = new URL(window.location);
if (!(href.startsWith("/") || hrefURL.host === pageURL.host)) {
return true;
}
return false;
} }