[vlc] Get video resoltion on WWW-page

Brilliantov Kirill Vladimirovich brilliantov at byterg.ru
Thu Feb 10 10:56:41 CET 2011


Hello!
I have embedded vlc on www-page for look rtsp strem.

HTML code:
<html>
<head>
<script type = "text/javascript" src = "js/jquery.min.js"></script>
<script type = "text/javascript" src = "js/livevideo.js"></script>
</head>
<body>
<div id = "video"></div>
</body></html>

Livevideo code (jQuery 1.5):
$(function(){
if ($.browser.msie) {
   $('#video').html('<object ' +
                    '"clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" ' +
                    'width = "100%" height = "100%" ' +
                    'events = "True" id = "vlc">' +
                    '<embed pluginspage = "http://www.videolan.org" ' +
                    'type = "application/x-vlc-plugin" ' +
                    'version = "VideoLAN.VLCPlugin.2" ' +
                    'width = "100%" height = "100%" ' +
                    'name = "vlc" text = "Please install VLC player">' +
                    '</embed></object');
} else if ($.browser.mozilla || $.browser.webkit) {
    $('#video').html('<embed type = "application/x-vlc-plugin" ' +
  		     'pluginspage = "http://www.videolan.org" ' +
		     'version = "VideoLAN.VLCPlugin.2" ' +
		     'width = "100%" height = "100%" ' +
		     'id = "vlc" text = "Please install VLC player">' +
                     '</embed>');
} else {
    $('#video').html('Only Mozilla Firefox, Internet Explorer ' +
                     'and GoogleChrome supported!');
}
	
var vlc = $('#vlc')[0];
var id = vlc.playlist.add('rtsp://' + window.location.hostname +
                              ':8557/PSIA/Streaming/channels/' +
                              '2?videoCodecType=H.264');
vlc.playlist.playItem(id);
//alert(vlc.video.width)
});

I successfully get video on html-page, but I can't get video resolution,
vlc.video.width retrun 0.

How can I get video resolution?

Thank you and excuse me for my bad english.

-- 
С уважением,
Бриллиантов Кирилл Владимирович
…………………………………………………………………
программист, технический отдел
ООО «БайтЭрг»
Видеокамеры МВК – Эффективность разумных решений
…………………………………………………………………
+7(495)221-66-22 доб.122
http://www.byterg.ru    http://www.bestdvr.ru



More information about the vlc mailing list