I am interested in developing an iOS application that can play YouTube videos in a UIWebView window. Users should have the option to play the videos directly on their iOS device or stream them via AirPlay to an AppleTV.
The content displayed in the UIWebView will be from my own website, which will include JavaScript to communicate with the app when a YouTube video ends (utilizing the YouTube iframe API).
My question is: Is the above scenario feasible?
According to the iOS documentation, I need to include the following HTML code within the UIWebView:
<video src="myPlaylist.m3u8"
height="300" width="400"
x-webkit-airplay="allow" >
<embed airplay="allow"
src="movie.mov"
width=400
height=300
mime-type="video/quicktime">
</embed>
</video>
However, since the YouTube iFrame API does not allow access to the <video> tag, I am unsure how to make the AirPlay icon visible to the user in the UIWebView window.
I appreciate any guidance or suggestions that can be offered.
Sincerely, Jim