[英]Unable to play video with VLC activeX plugin in IE9 and earlier
I am trying to play a video in IE9 and earlier versions. 我正在尝试在IE9和更早版本中播放视频。 For that I used activeX plugin to load VLC Media Player (that is my basic requirement).
为此,我使用activeX插件加载VLC Media Player(这是我的基本要求)。
When I tried to execute my code I got an error thrown: 当我尝试执行代码时,抛出了错误:
Unable to get value of the property 'playlist': object is null or undefined
My code as follows: 我的代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>VLC API</title>
<script src="http://code.jquery.com/jquery-2.1.0.min.js"></script>
<script>
$(document).ready(function(){
play();
displayPlugins();
$(function(){
$("#vlc").css({ "width": "400px", "height": "300px" });
});
});
function play()
{
var vlc=document.getElementById("vlc");
alert("play video");
var url="rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov";
var options=new Array(":aspect-ratio=4:3","-rtsp-tcp");
var id= vlc.playlist.add(url,"",options);
vlc.playlist.playItem(id);
}
function displayPlugins()
{
alert("plugins");
var player="<object type='application/x-vlc-plugin' id='vlc' width='300' height='225' classid='clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921' codebase='http://activex.microsoft.com/controls/vb5/comdlg32.cab'></object>";
$("#video_holder").html(player);
}
</script>
</head>
<body>
<div id="video_holder" style="border:1px solid #00FF33; height:350px;"></div>
</body>
Can anybody help me where I'm getting wrong? 有人可以帮我解决我的问题吗?
You are doing: 您正在执行:
var vlc=document.getElementById("vlc");
But on HTML, you have 但是在HTML上,
<div id="video_holder" style="border:1px solid #00FF33; height:350px;"></div>
So in theory you want: 因此,理论上您想要:
var vlc=document.getElementById("video_holder");
You might have more problems after that, but start here. 之后,您可能会有更多问题,但从这里开始。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.