Migrating from Native Video Node to the Bitmovin Player
In this guide, we will show you how to migrate from the Roku Native Video Node to the Bitmovin Player in just two simple steps.
Step 1: Add & configure your Bitmovin Player
First, we need to add our component library to your app. To do that create a ComponentLibrary
node.
m.bitmovinPlayerSDK = CreateObject("roSGNode", "ComponentLibrary")
m.bitmovinPlayerSDK.id = "BitmovinPlayerSDK"
m.bitmovinPlayerSDK.uri = "https://cdn.bitmovin.com/player/roku/1/bitmovinplayer.pkg"
Next, start the download of the component library by adding it to your scene and check for the download being finished by observing the loadStatus
field.
m.top.appendChild(m.bitmovinPlayerSDK)
m.bitmovinPlayerSDK.observeField("loadStatus", "onLoadStatusChanged")
Once the download of the library is complete you can create an instance of the player.
sub onLoadStatusChanged()
if (m.bitmovinPlayerSDK.loadStatus = "ready") then
m.bitmovinPlayer = CreateObject("roSGNode", "BitmovinPlayerSDK:BitmovinPlayer")
end sub
And finally, add the Bitmovin Player License Key to your channel manifest
:
# License key
bitmovin_player_license_key=YOUR_LICENSE_KEY
You can find your license key in your Bitmovin Dashboard under "Player" -> "Licenses". This security mechanism protects your license from being used elsewhere.
Step 2: Replace native video node references in your project
Remove all instances of roSGNode
of type Video
from your app and use the Bitmovin Player instead. You can use the same contentNode
you have been using before.
- m.video = CreateObject("roSGNode", "Video")
- m.video.content = contentNode
- m.video.control = "play"
+ m.bitmovinPlayer = CreateObject("roSGNode", "BitmovinPlayerSDK:BitmovinPlayer")
+ m.bitmovinPlayer.callFunc("load", contentNode)
+ m.bitmovinPlayer.callFunc("play", invalid)
Note
It is good practice to only ever have one instance of a video node on Roku, be that a native one or the Bitmovin one, to avoid conflicts between the two as well as unexpected behaviours.
Summary
In this guide, we demonstrated how easy it is to migrate from the Native Video Node to the Bitmovin Player in just two simple steps: adding the Bitmovin Player and simply replacing the video node with it.
Next, you can
- check out our Getting Started Guide.
- download fully working examples and explore more features in our GitHub repository.
- choose additional platforms to deploy on in our Getting Started Hub and try our no-code wizards.
- browse our Bitmovin Player API reference.
- try our Analytics product to get real-time insights into your new Roku Player.
- see if some of the questions you might have are answered in our Community and ask your own!
Appendix: Mapping Tables
For more advanced use cases, we've created the following mapping tables to support your migration.
Video
node ➡️ Player
function mapping
Video
node ➡️ Player
function mappingVideo Node | Bitmovin Player |
---|---|
video.content = contentNode | bitmovinPlayer.callFunc("load", contentNode) orbitmovinPlayer.callFunc("load", bitmovinSourceConfig) |
video.control = "play" | bitmovinPlayer.callFunc("play", invalid) |
video.control = "pause" | bitmovinPlayer.callFunc("pause", invalid) |
video.control = "stop" | bitmovinPlayer.callFunc("unload", invalid) |
video.seek = target | bitmovinPlayer.callFunc("seek", target) ' For VoD content bitmovinPlayer.callFunc("timeShift", target) ' For live content |
video.duration | bitmovinPlayer.callFunc("getDuration", invalid) |
video.mute = true andvideo.mute = false | bitmovinPlayer.callFunc("mute", invalid) andbitmovinPlayer.callFunc("unmute", invalid) |
For a full list of all available functions check out our Bitmovin Player API reference.
Video
node ➡️ Player
field mapping
Video
node ➡️ Player
field mappingVideo Node | Bitmovin Player |
---|---|
video.state | bitmovinPlayer.playerState |
video.errorCode , video.errorMsg , video.errorStr | bitmovinPlayer.error.code , bitmovinPlayer.error.message , bitmovinPlayer.error.name |
video.position | bitmovinPlayer.timeChanged |
video.timedMetaData | bitmovinPlayer.metadata |
For a full list of all available fields check out our Bitmovin Player API reference.
Updated 12 months ago