Есть html страница на которую выводится видео, просмотр осуществляется с помощью VLC.
HTML-страница
Код: Выделить всё
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv = "Content-Type" content = "text/html; charset = utf-8">
<script type = "text/javascript" src = "js/jquery-1.4.2.min.js"></script>
<script type = "text/javascript" src = "js/livevideo.js"></script>
</head>
<body>
<h1>Live Video</h1>
<div id = "video"></div>
<br>
<div id = "control">
<input type = "button" value = "Play" id = "play">
<input type = "button" value = "Stop" id = "stop">
<input type = "button" value = "Pause" id = "pause">
</div>
</body>
</html>livevideo.js
Код: Выделить всё
$(function(){
if ($.browser.msie) {
$('#video').html('<object ' +
'type="application/x-vlc-plugin" ' +
'pluginspage = "http://www.videolan.org" ' +
'version = "VideoLAN.VLCPlugin.2" ' +
'classid = ' +
'"clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" ' +
'codebase = ' +
'"http://downloads.videolan.org/pub/videolan/vlc/' +
'latest/win32/axvlc.cab" ' +
'width = "100%" height = "100%" ' +
'events = "True" id = "vlc"></object>');
} else if ($.browser.mozilla || $.browser.safari) {
$('#video').html('<embed type = "application/x-vlc-plugin" ' +
'pluginspage = "http://www.videolan.org" ' +
'version = "VideoLAN.VLCPlugin.2" ' +
'width = "100%" height = "100%" ' +
'id = "vlc"></embed>');
} else {
$('#video').
html('Only Mozilla Firefox and Internet Expolrer supported!');
}
$('#video').css('width', '640px').css('height', '480px');
var vlc = $('#vlc')[0];
var id = vlc.playlist.add('rtsp://' + window.location.hostname + '/jpeg');
vlc.playlist.playItem(id);
$('#play').bind('click', function(){vlc.playlist.play();});
$('#stop').bind('click', function(){vlc.playlist.stop();});
$('#pause').bind('click', function(){vlc.playlist.togglePause();});
});Всё замечательно в Firefox и GoogleChrome, но не в IE.
В InternetExplorer, проверяю в версии 8, нет видео - почему то не встраивается код <object>, условие по проверке типа броузера точно срабатывавает.
В тоже время, если я внесу код <object> непосредственно в html-файл видео появляется.
Как можно решить эту проблему?
Спасибо.
Update
Попробовал пойти от обратного - встроил в страницу оба объекта и пробую в зависимости от броузера удалить ненужный. В FireFox сработало, в IE появилось видео, но блок для FireFox не удалился.