From 55973cec259b65fd4fd8e313646dab68aa4ccb86 Mon Sep 17 00:00:00 2001 From: tilt12345678 Date: Sat, 25 Jan 2025 23:49:35 +0100 Subject: [PATCH] fix debug output --- patches/mediaelement/02-play-promise.diff | 30 +++++++++++------------ 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/patches/mediaelement/02-play-promise.diff b/patches/mediaelement/02-play-promise.diff index e2dc628..a232527 100644 --- a/patches/mediaelement/02-play-promise.diff +++ b/patches/mediaelement/02-play-promise.diff @@ -8,7 +8,7 @@ index 28e87a66..88a71abf 100644 if (t.paused) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 'buildplaypause ... t.paused': ", _promise); ++ console.debug("play() returned promise at 'buildplaypause ... t.paused': ", _promise); } else { t.pause(); } @@ -22,7 +22,7 @@ index b9cf2b96..07c400f3 100644 setTimeout(function() { - player.play(); + var _promise = player.play(); -+ debug("play() returned promise at 'start again to track new time': ", _promise); ++ console.debug("play() returned promise at 'start again to track new time': ", _promise); }, 0); } } @@ -32,7 +32,7 @@ index b9cf2b96..07c400f3 100644 setTimeout(function() { - player.play(); + var _promise = player.play(); -+ debug("play() returned promise at 'start again to track new time (#2)': ", _promise); ++ console.debug("play() returned promise at 'start again to track new time (#2)': ", _promise); }, 0); } } @@ -42,7 +42,7 @@ index b9cf2b96..07c400f3 100644 if (new Date() - lastKeyPressTime >= 1000) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 'restartPlayer': ", _promise); ++ console.debug("play() returned promise at 'restartPlayer': ", _promise); } }, handleMouseup = () => { @@ -52,7 +52,7 @@ index b9cf2b96..07c400f3 100644 t.slider.focus(); - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 't.forcedHandlePause': ", _promise); ++ console.debug("play() returned promise at 't.forcedHandlePause': ", _promise); } t.forcedHandlePause = false; } @@ -62,7 +62,7 @@ index b9cf2b96..07c400f3 100644 if (t.paused) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 'IS_FIREFOX ... t.paused': ", _promise); ++ console.debug("play() returned promise at 'IS_FIREFOX ... t.paused': ", _promise); } else { t.pause(); } @@ -76,7 +76,7 @@ index 0a2a25b2..9091eaf5 100644 if (IS_IPAD && t.node.getAttribute('autoplay')) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 'override Apple's autoplay override for iPads': ", _promise); ++ console.debug("play() returned promise at 'override Apple's autoplay override for iPads': ", _promise); } } else if ((t.isVideo || (!t.isVideo && (t.options.features.length || t.options.useDefaultControls))) && !(IS_ANDROID && t.options.AndroidUseNativeControls)) { @@ -86,7 +86,7 @@ index 0a2a25b2..9091eaf5 100644 if (!IS_IOS && !IS_ANDROID) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at '!IS_IOS && !IS_ANDROID': ", _promise); ++ console.debug("play() returned promise at '!IS_IOS && !IS_ANDROID': ", _promise); } } }); @@ -96,7 +96,7 @@ index 0a2a25b2..9091eaf5 100644 if (autoplay && isNative) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 'force autoplay for HTML5': ", _promise); ++ console.debug("play() returned promise at 'force autoplay for HTML5': ", _promise); } if (t.options.success) { @@ -106,7 +106,7 @@ index 0a2a25b2..9091eaf5 100644 } else if (t.paused) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 'else if (t.paused)': ", _promise); ++ console.debug("play() returned promise at 'else if (t.paused)': ", _promise); } else { t.pause(); } @@ -116,7 +116,7 @@ index 0a2a25b2..9091eaf5 100644 if (t.options.loop) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 't.options.loop': ", _promise); ++ console.debug("play() returned promise at 't.options.loop': ", _promise); } else if (!t.options.alwaysShowControls && t.controlsEnabled) { t.showControls(); } @@ -126,7 +126,7 @@ index 0a2a25b2..9091eaf5 100644 if (autoplay && isNative) { - t.play(); + _promise = t.play(); -+ debug("play() returned promise at 'autoplay && isNative': ", _promise); ++ console.debug("play() returned promise at 'autoplay && isNative': ", _promise); } if (t.options.success) { @@ -136,7 +136,7 @@ index 0a2a25b2..9091eaf5 100644 if (t.paused) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 't.options.clickToPlayPause ... t.paused': ", _promise); ++ console.debug("play() returned promise at 't.options.clickToPlayPause ... t.paused': ", _promise); } else { t.pause(); } @@ -146,7 +146,7 @@ index 0a2a25b2..9091eaf5 100644 if (t.paused) { - t.play(); + var _promise = t.play(); -+ debug("play() returned promise at 't.paused': ", _promise); ++ console.debug("play() returned promise at 't.paused': ", _promise); } else { t.pause(); } @@ -160,7 +160,7 @@ index a29484c0..d3040193 100644 node.load(); - node.play(); + var _promise = node.play(); -+ debug("play() returned promise at 'Reload the source only in case of the renderer is active at the moment': ", _promise); ++ console.debug("play() returned promise at 'Reload the source only in case of the renderer is active at the moment': ", _promise); } else { mediaElement.generateError('Media error: Format(s) not supported or source(s) not found', mediaFiles); }