xcode html5插件,xcode - WKWebView Mac Browser Enable fullscreen html5? - Stack Overflow

I made a simple browser with Swift last version and xcode 8.3.3.

I want to be able to enter in fullscreen when there is an html5 video (like on youtube).

I get "full screen is unavailable" on youtube right now.

Same problem with the old WebView... on iOS it work.

EDIT. Maybe it's just not possible. I tried to look at JavaFX WebView and WPF WebBrowser and they have the same limitation. Actually one guy was able to allow full screen for a youtube video on WPF WebBrowser but only by creating a full html page:

Playing youtube in full screen in WebBrowser control

And of course I cannot create a webpage for every video in a page (at least I don't know how, if you know please tell me).

ORIGINAL MESSAGE:

I made a simple browser with Swift last version and xcode 8.3.3.

Everything is working but I'm not able to activate plugins like I can do with the old WebView.

Since I'm on a mac I should be able to activate plugins (I understand that it's not possible on iOS) am I wrong?

Also (and here I got the same problem in the old WebView) there is no way to activate fullscreen for html5 videos (at least I don't know how).

@IBOutlet weak var webView: WKWebView!

let urlString = "http://myurl.com/"

self.webView.load(NSURLRequest(url: NSURL(string: urlString)! as URL) as URLRequest!)

self.webView.configuration.preferences.plugInsEnabled = true

This is the really basic code to get a basic browser working. But there is no option to enable plugin in the Interface Builder for WKWebView and I really don't know how to allow fullscreen for html5 videos (like youtube).

EDIT. Ok I finally found an answer for the plugin part:

self.webView.configuration.preferences.plugInsEnabled = true

really easy but it was difficult to understand where to find it I had to go here:

https://developer.apple.com/documentation/webkit/webpreferences

and take a guess...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值