How to get AVPlayer in web page using WKWebView in swift?
<p>I used the <a href="https://github.com/youtube/youtube-ios-player-helper" rel="nofollow noreferrer">youtube-ios-player-hepler</a> library, but there were some memory leaks because <code>YTPlayerView</code> inherited <code>UIWebView</code>.</p>

<p><a href="https://stackoverflow.com/questions/33598098/uiwebview-is-not-deallocating-memory">UIWebView is not deallocating memory</a></p>

<p>Getting the instance of <code>AVPlayer</code> with an <code>UIWebView</code> which I used to use enabled me control its volume of the sound.</p>

<p>But, as you can see, I could not use it as It had the bugs that <code>UIWebView</code> itself has errors of memory leak on iOS9.</p>

<p>That is why I decided to replace the library (<code>YTPlayer+UIWebView</code>) into <code>WKWebView</code>,
but using <code>WKWebView</code> caused another problem that the notification of <code>AVPlayerItemBecameCurrentNotification</code> could not be called.</p>

<p>In what kind of way, could you tell me how I can control the volume of sound even with <code>WKWebView</code>.</p>

<p>How can you control the volume with <code>WKWebView</code>?</p>