forked from jackzhang1204/sewise-player
-
Notifications
You must be signed in to change notification settings - Fork 0
/
vod_api.html
84 lines (83 loc) · 3.2 KB
/
vod_api.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<title>Sewise Player</title>
</head>
<body>
<div style="width: 640px; height: 360px; ">
<script type="text/javascript" src="../player/sewise.player.min.js?server=vod&type=mp4&videourl=https://www.w3schools.com/html/mov_bbb.mp4&sourceid=&autostart=true&starttime=0&lang=en_US&logo=https://onvod.sewise.com/libs/swfplayer/skin/images/logo.png&title=VodVideo 点播标题&buffer=5&skin=vodWhite&fallbackurls=%7B%0A%09%22ogg%22%3A%20%22http%3A%2F%2Fwww.w3schools.com%2Fhtml%2Fmov_bbb.ogg%22%2C%0A%09%22webm%22%3A%20%22http%3A%2F%2Fwww.w3schools.com%2Fhtml%2Fmov_bbb.webm%22%0A%7D"></script>
</div>
<script>
//点播接口调用方法
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("https://media.w3.org/2010/05/sintel/trailer.mp4", "Sintel", 0, true);
}
//播放器回调方法
function playerReady(name){
console.log("Sewise Player On Ready");
//SewisePlayer.toPlay("https://www.w3school.com.cn/i/movie.mp4", "title", 0, false);
}
function onStart(name){
console.log("onStart");
}
function onStop(name){
console.log("onStop");
}
function onMetadata(meta, name){
console.log("onMetadata");
}
function onClarity(clarity, name){
console.log("onClarity");
}
function onPause(name){
console.log("onPause");
}
function onSeek(time, name){
console.log("onSeek: " + time);
}
function onPlayTime(time, name){
console.log("onPlayTime: " + time);
}
</script>
<div style="padding-top: 20px;">
<div style="padding-right: 20px;float: left;">[点播接口]</div>
<div style="padding-right: 20px;float: left;"><a href="javascript:startPlay();">播放</a></div>
<div style="padding-right: 20px;float: left;"><a href="javascript:playPause();">暂停</a></div>
<div style="padding-right: 20px;float: left;"><a href="javascript:seekTo();">跳转</a></div>
<div style="padding-right: 20px;float: left;"><a href="javascript:playStop();">停止</a></div>
<div style="padding-right: 20px;float: left;"><a href="javascript:changeVolume();">更改音量</a></div>
<div style="padding-right: 20px;float: left;"><a href="javascript:getDuration();">获取总时长</a></div>
<div style="padding-right: 20px;float: left;"><a href="javascript:getPlayTime();">获取当前时间</a></div>
<!-- <div style="padding-right: 20px;float: left;"><a href="javascript:switchProgram();">切换节目</a></div> -->
<div style="padding-right: 20px;float: left;"><a href="javascript:switchVideo();">切换视频</a></div>
<br clear="all"/>
</div>
</body>
</html>