How to get AVPlayer on a webpage using WKWebView in swift?

I used the youtube-ios-player-hepler library , but there were memory leaks because I YTPlayerViewinherited it UIWebView.

UIWebView does not free memory

Getting the instance AVPlayerwith the help UIWebViewthat I used allowed me to control its volume.

But, as you can see, I could not use it, because it had errors in which it UIWebViewitself had memory leak errors on iOS9.

That's why I decided to replace the library ( YTPlayer+UIWebView) with WKWebView, but the use WKWebViewcaused another problem that prevented the notification from being called AVPlayerItemBecameCurrentNotification.

How could you tell me how I can control the sound volume even with WKWebView.

How can you control the volume with WKWebView?

+4
source share

Source: https://habr.com/ru/post/1653587/


All Articles