youtube / youtube-ios-player-helper

Lightweight helper library that allows iOS developers to add inline playback of YouTube videos through a WebView
Other
1.64k stars 677 forks source link

iframe does not give option to deny airplay. #469

Open indrajit-chavda opened 2 years ago

indrajit-chavda commented 2 years ago

Hey, I am embedding youtube videos in the mobile apps, I want youtube videos to play only on mobile and not mirror or airplay outside.

Apple has a document that says to set x-webkit-airplay = "deny" but how to do it for iFrame on mobile?.

I have tried to execute the JS: document.getElementById("player")?.querySelector('.html5-video-player')?.querySelector('.html5-video-container').querySelector('video').setAttribute('x-webkit-airplay','deny') But it updates in Safari but not in mobile WKWebview.

Thanks in advance.

ankit0812 commented 2 years ago

+1