|
本帖最后由 足心 于 2016-4-14 08:21 编辑
var videoUrl = VIDEO_URL; // Just play a video window.plugins.vitamio.playVideo(videoUrl);
// Play a pre-recorded video with callbacks
var options = {
isStreaming: false,
successCallback: function(obj) {
console.log("Video was closed without error at " + obj.pos + ".");
},
progressCallback: function(obj) {
// obj.action may be "start", "stop", or "pause"
// obj.pos is the current time in the clip (only available for non-continuous streams)
// and shows a format of "00:12:34"
myAnalytics.track(obj.action, obj.pos);
},
errorCallback: function(obj) {
console.log("Error! " + obj.message);
}
};
window.plugins.vitamio.playVideo(videoUrl, options);
var audioUrl = STREAMING_AUDIO_URL;
// Simply play an audio file (not recommended, since the screen will be plain black)
window.plugins.vitamio.playAudio(audioUrl);
// Play an audio file with options (all options optional)
var options = {
isStreaming: true,
bgColor: "#FFFFFF",
bgImage: "<SWEET_BACKGROUND_IMAGE>",
bgImageScale: "fit",
successCallback: function() {
console.log("Player closed without error.");
},
errorCallback: function(obj) {
console.log("Error! " + obj.message);
}
};
window.plugins.vitamio.playAudio(audioUrl, options);
来自:https://github.com/nchutchind/Vitamio-Cordova-Plugin
希望对你有帮助,如果谁有可以断点续播功能的插件什么的话希望可以分享一下,或者谁用的vitamio插件能断点续播希望可以分享一下经验注:流媒体播放
|
|