======
The net.nopattern.cordova.brightcoveplayer
object provides functions to make interacting with the native player provided by Brightcove for Cordova. Player works with Brightcove Video Cloud hosting (so you can play video by Brigthcove ID) and also you can play any video by providing the video URL. Ability to work with IMA Ad also implemented.
cordova plugin add https://github.com/4screens/brightcove-player-cordova-plugin.git
WARNING! Updated to version 2 (based on Brightcove SDK 1.4.7). Please use v1 if you still use ant on android.
- cordova.plugins.BrightcovePlayerPlugin.init
- cordova.plugins.BrightcovePlayerPlugin.setLanguage
- cordova.plugins.BrightcovePlayerPlugin.playByUrl
- cordova.plugins.BrightcovePlayerPlugin.playById
These events are fired on the window.
-
Fired on player shown
- iOS
- Android
-
Fired on player hide
- iOS
- Android
-
Fired on player play.
The duration of video value is passed as a parameter "duration" with the event (time in ms). You can find the time value of moment when event was fired in "currentTime" variable (ms).
- iOS
- Android
-
Fired on player pause You can find the time value of moment when event was fired in "currentTime" variable (ms).
- iOS
- Android
-
Fired on video ended
- iOS
- Android
-
Fired on video buffering
- iOS
- Android
-
Fired on Ad started
- iOS
- Android
-
Fired on Ad completed
- iOS
- Android
-
Fired after video seeked
- Android
This method make accessable the ability to get video by brightcove ID. You must provide your Brigthcove Token as parameter.
cordova.plugins.BrightcovePlayerPlugin.init(brightcoveToken);
- Android
- iOS
Sets the preferred language for the ad UI. This must be a 2-letter ISO 639-1 language code. If invalid or unsupported, the language will default to "en" for English.
cordova.plugins.BrightcovePlayerPlugin.setLanguage(lang);
ISO 639-1 list: http://www.loc.gov/standards/iso639-2/php/English_list.php
- Android
- iOS
Play video by Brightcove Video Reference ID. You must init the brightcove before using with BrightcovePlayerPlugin.init!
cordova.plugins.BrightcovePlayerPlugin.playById(brigthcoveVideoId);
Also if you want to preroll Ad before your video just provide Vast link as the second parameter.
cordova.plugins.BrightcovePlayerPlugin.playById(brigthcoveVideoId, vastLink);
- Android
- iOS
Play video by URL. There is no need in init.
cordova.plugins.BrightcovePlayerPlugin.playByUrl(videoUrl);
Also if you want to preroll Ad before your video like in playById just provide Vast link as the second parameter.
cordova.plugins.BrightcovePlayerPlugin.playByUrl(videoUrl, vastLink);
- Android
- iOS
- Localization for "Done" button