JWPlayerViewController is a customizable view controller that allows you to display user controls for a prepackaged video experience without having to implement your own interface.
- JWPlayerKit 4.0.0+
The following table lists the customizable native features of the
This class does not allow for 100% customization. For more customization or a simpler interface, use
JWPlayerViewand assign your own delegates to the player.
Logo/Watermarks: Add a unique logoto your app
Skinning: Customize and define the player skin
AirPlay: Stream to iOS devices through clicking the AirPlay button
Google Cast: Stream to Cast devices when linked with the Cast framework
VAST: Monetize content with JWP VAST ads (native customization supported)
Fullscreen: Initiate fullscreen mode by tapping a button, rotating the device, triggering an event, or calling a method
Lock screen controls: Enable or disable lock screen controls for content
Playback rates: Define the available playback rates for your content
Poster Image: The poster image you specify for a player item will display at the beginning of a video unless
Picture in Picture: Display or hide a Picture in Picture button
Playlist button: Playlist button that allows users to navigate through media and choose the next media to be played
If your content has Recommendations, this can be accessed through the playlist screen. The Recommendations menu will also appear at the end of a playlist or during the autoplay screen, if set up in your configuration.
The interface comes with a centered play/pause button and fast-forward/rewind buttons (15 seconds). If the currently playing media is part of a playlist there are also centered next/previous buttons. These do not appear unless you are viewing a playlist.
The interface will stay on during audio-only content, but by default the interface will only appear when the user taps it. It will fade after three seconds, but this can be customized by setting the
interfaceFadeTime property. The interface can also be set to always show or always hide using the
Another feature related to seeking is double tapping the left or right side of the screen. With or without the controls on the screen, this will trigger a rewind 15 seconds or fast forward 15 seconds event.
You have full access to the
JWPlayer object through the
player property. If you wish to call methods on the player directly, such as
pause(), setting other properties or querying the state of the player, use this property.
You also have full access to the
JWPlayerView through the
playerView property. You can set its properties by using this.
When using the
playerView properties you will notice they differ from the
JWPlayer base types in that they do not allow you to set the delegate properties.
JWPlayerViewController conforms to every delegate, and is already the assigned delegate for its player.
In order to listen for events, you need to subclass
JWPlayerViewController. This allows you to override any delegate methods. Please refer to the delegates listed in JWPlayerView and JWPlayer for more information on the delegates and their methods.
When you override a delegate method in your
JWPlayerViewControllersubclass, always call the
supermethod before your implementation, as in the snippets presented here in our documentation.
In addition, the
JWPlayerViewController itself has a delegate property which takes a
JWPlayerViewControllerDelegate. Conforming to this delegate allows you to listen for view controller-specific events, such as the following:
- Fullscreen state
- Related and Recommended item state and choices
- Player size changes
- Screen taps
Updated 2 days ago