You can write your own video player to play videos that React VR doesn't support.
React VR uses an HTML5
<video> element for video playback, however you may have a custom format and use your own video player.
React VR doesn't expect to cover all these features, however we provide a way to hook your customized video player into the React VR video module.
BasicVideoPlayer is the default video player which embedded HTML5
<video> element for video playback. Your customized video player needs to extend
BasicVideoPlayer. Here're some important properties and methods of
BasicVideoPlayer that you may want to override.
<VideoPano>is set, the video module will call this method to intialize the video. You can pass extra metaData to your video player in
source.metaDatato help you initialize the video(e.g. pass the proxy to play DRM contents).
You can hook a customized video player with React VR by calling
addCustomizedVideoPlayer. If you have more than one customized video players, you can call
addCustomizedVideoPlayer for each of them. React VR will choose the appropriate player via the video formats they support.
One example of using customized video player is to support adaptive bitrate streaming such as MPEG-DASH.
The customized video player needs to extend
Also define the supportedFormats for DashVideoPlayer. DashVideoPlayer's supported video formats depend on the HTML5
<video> element's supported formats
Create the MPEG-DASH player:
Initialize the MPEG-DASH player:
_bindMediaEvents() is used to register to html media events.
Dispose the player:
addCustomizedVideoPlayer to hook the
DashVideoPlayer in the
init function of
vr/client.js (one of the files provided as part of the Starter Project).
DashSample for the full code of this example.
You can file an issue on GitHub if you see a typo or error on this page!