下面就简单的说一下这个视频插件的介绍、功能及使用
插件的官方文档地址为:https://github.com/jackzhang1204/sewise-player
播放器是主要以HTML5技术为平台开发,同时兼容Flash技术,实现了跨平台各浏览器兼容的视频播放。使用Sewise Player您可以在Windows, MacOS, Linux,Windows Phone, Android, IOS等任意平台上,通过对应的浏览器播放视频。
Sewise Player使用非常简单,只要在页面对应的DIV内嵌入一个JS文件即可,播放器将通过自动识别浏览器的功能来启用HTML5或Flash模式播放视 频。您不需要掌握任何JavaScript或ActionScript编码技术就可以制作出专业的网页视频播放器。
Sewise Player即可以做为单一的前台播放器来在页面上播放视频和流,也可以结合Sewise Server后台技术实现专业的可交互的点播、直播视频播放。
<div style="width: 640px; height: 360px; ">
<script type="text/javascript" src="../player/sewise.player.min.js"></script> <script type="text/javascript"> SewisePlayer.setup({ server: "vod", type: "mp4", videourl: "http://jackzhang1204.github.io/materials/mov_bbb.mp4", skin: "vodWhite", title: "Tile 标题", lang: 'zh_CN', fallbackurls:{ ogg: "http://jackzhang1204.github.io/materials/mov_bbb.ogg", webm: "http://jackzhang1204.github.io/materials/mov_bbb.webm" } }); </script> </div>
<div style="width: 640px; height: 360px; ">
<script type="text/javascript" src="../player/sewise.player.min.js?server=vod&type=mp4&videourl=http://www.w3schools.com/html/mov_bbb.mp4&sourceid=&autostart=true&starttime=0&lang=en_US&logo=http://onvod.sewise.com/libs/swfplayer/skin/images/logo.png&title=VodVideo&buffer=5&skin=vodWhite"></script> </div>
<div style="width: 640px; height: 360px; ">
<script type="text/javascript" src="http://219.232.161.202/libs/swfplayer/player/sewise.player.min.js?server=vod&sourceid=eQgPHj4N&autostart=true&starttime=0&lang=en_US&logo=http://onvod.sewise.com/libs/swfplayer/skin/images/logo.png&buffer=5&skin=vodWhite"></script> </div>
<div style="width: 640px; height: 360px; ">
<script type="text/javascript" src="../player/sewise.player.min.js?server=live&type=rtmp&streamurl=rtmp://219.232.161.204/livestream/mtzysunq&autostart=true&pid=&shifttime=&buffer=5&lang=en_US&logo=http://onvod.sewise.com/libs/swfplayer/skin/images/logo.png&title=LiveVideo&skin=liveWhite"></script> </div>
<div style="width: 640px; height: 360px; ">
<script type="text/javascript" src="http://219.232.161.204/libs/swfplayer/player/sewise.player.min.js?server=live&autostart=true&pid=vk5nx2cj&shifttime=&buffer=5&lang=en_US&logo=http://onvod.sewise.com/libs/swfplayer/skin/images/logo.png&skin=liveWhite"></script> </div>
customdatas: { "logoLink": "http://www.baidu.com/" }
videosjsonurl: { "programname":"json url ? : 测试 % 地址", "videos": [ { "name":"普通", "url":"http://219.232.161.206:5080/flvseek/data/userdata/vismam/receive/201311/TRo4TUsO.flv" }, { "name":"标清", "url":"http://219.232.161.202:5080/flvseek/data/userdata/vod/resource/201402/OVNNwRk1.flv" } ] }
fallbackurls:{ mp4: "http://jackzhang1204.github.io/materials/mov_bbb.mp4", ogg: "http://jackzhang1204.github.io/materials/mov_bbb.ogg", webm: "http://jackzhang1204.github.io/materials/mov_bbb.webm", m3u8: "http://jackzhang1204.github.io/materials/mov_bbb.m3u8" }
SewisePlayer.doPlay();
SewisePlayer.doPause();
SewisePlayer.doStop();
SewisePlayer.doSeek(20);
SewisePlayer.doSeek("20130503123055");
SewisePlayer.toPlay("http://192.168.1.219:5080/flvseek/data/26144610yg.flv","深圳卫视", 20, true);
SewisePlayer.toPlay("rtmp://192.168.1.219/livestream/6jzcdjgi", "深圳卫视", "20130927150000", true);
SewisePlayer.setVolume(0.5);
SewisePlayer.playTime();
SewisePlayer.fullScreen();
SewisePlayer.noramlScreen();
SewisePlayer.bufferProgress();
SewisePlayer.playProgram("jCAH3SAY", 20, true);
SewisePlayer.duration();
SewisePlayer.doLive();
SewisePlayer.playChannel("y894tgf3", "20130503123456", true);
SewisePlayer.liveTime();
SewisePlayer.setDuration(645);
function playerReady(id) {
SewisePlayer.doSeek(10);
}
或
SewisePlayer.playerReady(function(id){
SewisePlayer.doSeek(10);
});
function onStart(id){
console.log("play start 1")
}
或
SewisePlayer.onStart(function(id){
console.log("play start 2");
});
function onPause(id){
console.log("play pause 1")
}
或
SewisePlayer.onPause(function(id){
console.log("play pause 2");
});
function onStop(id){
console.log("play stopped 1")
}
或
SewisePlayer.onStop(function(id){
console.log("play stopped 2");
});
function onSeek(time, id){
console.log("play seek 1: " + time)
}
或
SewisePlayer.onSeek(function(time, id){
console.log("play seek 2: " + time);
});
function onPlayTime(time, id){
console.log("onPlayTime 1: " + time);
}
或
SewisePlayer.onPlayTime(function(time, id){
console.log("onPlayTime 2: " + time);
});
function onMetadata(meta, id){
console.log("onMetadata 1");
}
或
SewisePlayer.onMetadata(function(meta, id){
console.log("onMetadata 2");
});
function onClarity(clarity, id){
console.log(clarity.id + "\n" + clarity.name + '\n' + clarity.videoUrl);
}
或
SewisePlayer.onClarity(function(clarity, id){
console.log(clarity.id + "\n" + clarity.name + '\n' + clarity.videoUrl);
});
function onBuffer(pt, id){
console.log("onBuffer 1: " + pt);
}
或
SewisePlayer.onBuffer(function(pt, id){
console.log("onBuffer 2: " + pt);
});