Skip to content

Instantly share code, notes, and snippets.

@brimestoned
Last active March 1, 2019 23:28
Show Gist options
  • Save brimestoned/89c7382a4bb4ef2e0c20bc569273dbf5 to your computer and use it in GitHub Desktop.
Save brimestoned/89c7382a4bb4ef2e0c20bc569273dbf5 to your computer and use it in GitHub Desktop.
MBS calls for VideoJS
# Toggle Play/Pause
MBS( "WebView.RunJavaScript"; "webView"; "togglePlay();" )
# Play video
MBS( "WebView.RunJavaScript"; $WebView ; "_play();" )
# Pause video
MBS( "WebView.RunJavaScript"; $WebView ; "_paused();" )
# Jump from current location
MBS( "WebView.RunJavaScript"; "webView"; "addToCurrentPosition(10);" )
# Go to specific location of video
MBS( "WebView.RunJavaScript"; "webView"; "goTo(10);” )
# Mark In at 5s and out at 15s then playloop indefinitly
MBS( "WebView.RunJavaScript"; "webView"; "setLoop(5,15);" )
# Mark In at current location and out at 15s ahead then playloop indefinitly
MBS( "WebView.RunJavaScript"; "webView"; "setLoop(-1,15);" )
# Mark In at current location and out at end of video then playloop indefinitly
MBS( "WebView.RunJavaScript"; "webView"; "setLoop(-1,-1);" )
# Toggle loops
MBS( "WebView.RunJavaScript"; "webView"; "toggleLoop();" )
# Get refTC
MBS( "WebView.RunJavaScriptReturnTitle" ; "webView" ; "document.title=document.getElementById('refTC').innerHTML;" )
# Get timecode
MBS( "WebView.RunJavaScriptReturnTitle" ; "webView" ; "document.title=document.getElementById('timecode').innerHTML;" )
# Get currentTimeInSeconds
MBS( "WebView.RunJavaScriptReturnTitle" ; "webView" ; "document.title=document.getElementById('currentTimeInSeconds').innerHTML;" )
# Get status of player
MBS( "WebView.RunJavaScriptReturnTitle" ; "webView" ; "document.title=document.getElementById('status').innerHTML;" )
# Get current value of play rate
MBS( "WebView.RunJavaScriptReturnTitle" ; "webView" ; "document.title=document.getElementById('playRate').innerHTML;"
# Set play rate value (multiples of realtime)
MBS( "WebView.RunJavaScript"; "webView"; “setPlayRate(3);” )
# Toggle Theater mode
MBS( "WebView.RunJavaScript"; "webView"; "theaterMode();” )
# Set Background color (leave argument black it restore to default)
MBS( "WebView.RunJavaScript"; "webView"; "setColor('#FFFFFF');" ) //Set background to white
MBS( "WebView.RunJavaScript"; "webView"; "setColor();" ) //Set background to default color
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment