Merge branch 'ios-candidate'

This commit is contained in:
Maurice Parker
2020-02-21 17:02:14 -08:00
232 changed files with 7116 additions and 4736 deletions

View File

@@ -25,7 +25,6 @@ class ImageViewer {
this.loadingInterval = setInterval(callback, 100);
}
}
cancel() {
clearInterval(this.loadingInterval);
this.hideLoadingIndicator();
@@ -45,6 +44,7 @@ class ImageViewer {
y: rect.y,
width: rect.width,
height: rect.height,
imageTitle: this.img.title,
imageURL: canvas.toDataURL(),
};
@@ -58,7 +58,6 @@ class ImageViewer {
showImage() {
this.img.style.opacity = 1
window.webkit.messageHandlers.imageWasShown.postMessage("");
}
showLoadingIndicator() {
@@ -128,6 +127,7 @@ function showClickedImage() {
if (activeImageViewer) {
activeImageViewer.showImage();
}
window.webkit.messageHandlers.imageWasShown.postMessage("");
}
// Add the playsinline attribute to any HTML5 videos that don"t have it.
@@ -136,6 +136,7 @@ function showClickedImage() {
function inlineVideos() {
document.querySelectorAll("video").forEach(element => {
element.setAttribute("playsinline", true)
element.setAttribute("controls", true)
});
}
@@ -143,3 +144,18 @@ function postRenderProcessing() {
ImageViewer.init();
inlineVideos();
}
function stopMediaPlayback() {
document.querySelectorAll("iframe").forEach(element => {
var iframeSrc = element.src;
element.src = iframeSrc;
});
document.querySelectorAll("video, audio").forEach(element => {
element.pause();
});
}
window.addEventListener('DOMContentLoaded', (event) => {
window.webkit.messageHandlers.domContentLoaded.postMessage("");
});