当前位置: 首页 > 工具软件 > sewise > 使用案例 >

github html5视频直播,GitHub - jackzhang1204/sewise-player: HTML5 Video Player

鞠侯林
2023-12-01

//点播接口调用方法

function startPlay(){

SewisePlayer.doPlay();

}

function playPause(){

SewisePlayer.doPause();

}

function seekTo(){

SewisePlayer.doSeek(5);

}

function playStop(){

SewisePlayer.doStop();

}

function changeVolume(){

SewisePlayer.setVolume(0.1);

}

function getDuration(){

alert(SewisePlayer.duration());

}

function getPlayTime(){

alert(SewisePlayer.playTime());

}

// function switchProgram(){

// SewisePlayer.playProgram("xqfa3cZn", 0, true);

// }

function switchVideo(){

SewisePlayer.toPlay("http://media.w3.org/2010/05/sintel/trailer.mp4", "Sintel", 0, true);

}

//播放器回调方法

function playerReady(name){

console.log("Sewise Player On Ready 1");

//SewisePlayer.toPlay("http://www.w3school.com.cn/i/movie.mp4", "title", 0, false);

}

SewisePlayer.playerReady(function(name){

console.log("Sewise Player On Ready 2");

});

function onStart(name){

console.log("onStart 1");

}

SewisePlayer.onStart(function(name){

console.log("onStart 2");

});

function onStop(name){

console.log("onStop 1");

}

SewisePlayer.onStop(function(name){

console.log("onStop 2");

});

function onMetadata(meta, name){

console.log("onMetadata 1");

}

SewisePlayer.onMetadata(function(meta, name){

console.log("onMetadata 2");

});

function onClarity(clarity, name){

console.log("onClarity 1");

}

SewisePlayer.onClarity(function(clarity, name){

console.log("onClarity 2");

});

function onPause(name){

console.log("onPause 1");

}

SewisePlayer.onPause(function(name){

console.log("onPause 2");

});

function onSeek(time, name){

console.log("onSeek 1: " + time);

}

SewisePlayer.onSeek(function(time, name){

console.log("onSeek 2: " + time);

});

function onPlayTime(time, name){

console.log("onPlayTime 1: " + time);

}

SewisePlayer.onPlayTime(function(time, name){

console.log("onPlayTime 2: " + time);

});

function onBuffer(pt, name){

console.log("onBuffer 1: " + pt);

}

SewisePlayer.onBuffer(function(pt, name){

console.log("onBuffer 2: " + pt);

});

[点播接口]
播放
暂停
跳转
停止
更改音量
获取总时长
获取当前时间
切换视频
 类似资料: