From cac4ffd37e3347f8842978c0a0353f71a57687ed Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sat, 1 Apr 2023 21:55:15 -0500 Subject: [PATCH 1/2] Add fullscreen video support --- iOS/Article/PreloadedWebView.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iOS/Article/PreloadedWebView.swift b/iOS/Article/PreloadedWebView.swift index 16d2cbf73..99a3e258b 100644 --- a/iOS/Article/PreloadedWebView.swift +++ b/iOS/Article/PreloadedWebView.swift @@ -29,6 +29,9 @@ class PreloadedWebView: WKWebView { configuration.setValue(true, forKey: "allowUniversalAccessFromFileURLs") configuration.allowsInlineMediaPlayback = true configuration.mediaTypesRequiringUserActionForPlayback = .audio + if #available(iOS 15.4, *) { + configuration.preferences.isElementFullscreenEnabled = true + } configuration.setURLSchemeHandler(articleIconSchemeHandler, forURLScheme: ArticleRenderer.imageIconScheme) super.init(frame: .zero, configuration: configuration) From 8253fce7ba83e05580504583afa2fd28d624ccfa Mon Sep 17 00:00:00 2001 From: Maurice Parker Date: Sun, 2 Apr 2023 15:18:48 -0500 Subject: [PATCH 2/2] Remove code that didn't do anything when embedding YouTube videos --- Shared/Article Rendering/main.js | 52 -------------------------------- 1 file changed, 52 deletions(-) diff --git a/Shared/Article Rendering/main.js b/Shared/Article Rendering/main.js index e485eec5c..49bfd0804 100644 --- a/Shared/Article Rendering/main.js +++ b/Shared/Article Rendering/main.js @@ -172,60 +172,8 @@ function addYouTubeVideos() { youTubeFrame.setAttribute("style", "position: absolute; top: 0; left: 0; width: 100%; height: 100%;"); youTubeFrame.setAttribute("title", "YouTube video player"); youTubeFrame.setAttribute("frameborder", "0"); - youTubeFrame.setAttribute("allow", "encrypted-media; picture-in-picture; web-share"); youTubeFrame.setAttribute("allowfullscreen", "true"); bodyContainer.appendChild(youTubeFrame); - - // No YouTube ADS - YouTube https://github.com/GSRHackZ/No-ADS-YouTube - let ogVolume=1; - let pbRate = 1; - - setInterval(function(){ - if(document.getElementsByClassName("video-stream html5-main-video")[0]!==undefined){ - let ad = document.getElementsByClassName("video-ads ytp-ad-module")[0]; - let vid = document.getElementsByClassName("video-stream html5-main-video")[0]; - if(ad==undefined){ - pbRate = vid.playbackRate; - } - let closeAble = document.getElementsByClassName("ytp-ad-overlay-close-button"); - for(let i=0;i0){ - if(document.getElementsByClassName("ytp-ad-text ytp-ad-preview-text")[0]!==undefined){ - vid.playbackRate=16; - //console.log("Incrementally skipped unskippable ad!") - } - } - } - } - },100) } function processPage() {