This commit is contained in:
Peter
2019-08-30 23:32:32 +04:00
parent ee8deffc76
commit f1d1754aa5
326 changed files with 4981 additions and 2895 deletions

View File

@@ -2,6 +2,7 @@ import Foundation
import WebKit
import SwiftSignalKit
import UniversalMediaPlayer
import AppBundle
func extractYoutubeVideoIdAndTimestamp(url: String) -> (String, Int)? {
guard let url = URL(string: url), let host = url.host?.lowercased() else {
@@ -116,7 +117,7 @@ final class YoutubeEmbedImplementation: WebEmbedImplementation {
}
func setup(_ webView: WKWebView, userContentController: WKUserContentController, evaluateJavaScript: @escaping (String) -> Void, updateStatus: @escaping (MediaPlayerStatus) -> Void, onPlaybackStarted: @escaping () -> Void) {
let bundle = Bundle(for: type(of: self))
let bundle = getAppBundle()
guard let userScriptPath = bundle.path(forResource: "YoutubeUserScript", ofType: "js") else {
return
}