公司做监控的,用海康威视,视频保存后切割成 .264格式文件,将地址保存入数据库,我的任务是将它分类读取出来。
首先前去下载 VLC播放器:http://www.videolan.org/vlc/index.html
好顶赞的播放器,开源,轻巧,强大。安装时记得勾选IE插件和FireFox插件!
我本地配置了简易网站用于视频网络路径测试,切记,切记:网站配置MIME类型,新增 .264 video/mp4,否则播放器会卡住
脚本:Q_JcVideo.js
function handleMediaPlayerMediaChanged() {
//document.getElementById("info").innerHTML = "Media Changed";
}
function handle_MediaPlayerNothingSpecial() {
//document.getElementById("state").innerHTML = "Idle...";
}
function handle_MediaPlayerOpening() {
//onOpen();
}
function handle_MediaPlayerBuffering(val) {
//document.getElementById("info").innerHTML = val + "%";
}
function handle_MediaPlayerPlaying() {
//onPlay();
}
function handle_MediaPlayerPaused() {
//onPause();
}
function handle_MediaPlayerStopped() {
//onStop();
}
function handle_MediaPlayerForward() {
//document.getElementById("state").innerHTML = "Forward...";
}
function handle_MediaPlayerBackward() {
//document.getElementById("state").innerHTML = "Backward...";
}
function handle_MediaPlayerEndReached() {
//onEnd();
}
function handle_MediaPlayerEncounteredError() {
//onError();
}
function handle_MediaPlayerTimeChanged(time) {
// var vlc = getVLC("vlc");
// var info = document.getElementById("info");
// if (vlc) {
// var mediaLen = vlc.input.length;
// if (mediaLen > 0) {
// // seekable media
// info.innerHTML = formatTime(time) + "/" + formatTime(mediaLen);
// }
// }
}
function handle_MediaPlayerPositionChanged(val) {
// set javascript slider to correct position
}
function handle_MediaPlayerSeekableChanged(val) {
//setSeekable(val);
}
function handle_MediaPlayerPausableChanged(val) {
//setPauseable(val);
}
function handle_MediaPlayerTitleChanged(val) {
//setTitle(val);
//document.getElementById("info").innerHTML = "Title: " + val;
}
function handle_MediaPlayerLengthChanged(val) {
//setMediaLength(val);
}
//function autoHeightWidth() {
// $("#divright").width($(window).width() - 210);
// $(".layout1").height($(window).height());
// $("#video").height($(window).height());
// $("#vlcplayer").height($(window).height() - 20);
// $("#vlcplayer").width($(window).width() - 220);
//}
//window.onresize = function () { autoHeightWidth(); };
window.οnlοad=function() {
init();
}
window.οnunlοad=function() {
close();
}
function PlayVideo(url) {
var vlc = getVLC("vlcplayer"); //document.getElementById("vlcplayer");
vlc.playlist.ite