Using the YouTube iframe embed player, is there a way to trigger fullscreen programatically? I want to remove the default controls (using controls=0) but then have the ability to create custom fullscreen button by itself.
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
Make the iframe not fullscreen but fullpage:
The full page button in the right upper corner of the code snippet also works this way. If you want to make the browser full screen you could try
document.requestFullscreen();
, but this is still experimental and works on very few browsers. Take a look at the MDN topic of this function.EDIT: Just found this: https://developers.google.com/youtube/?csw=1#player_apis, the official youtube player API.
You can use this library XCDYouTubeKit instead of iframe player.
Its very simple and powerful. Supports full-screen as well as non full-screen.
Try the following in Webkit browsers:
Note that this won't work without a user gesture (in this case, 'click').