Page 1 of 1

VLC <object> width are height aer rendered as 0

Posted: 24 Oct 2014 20:19
by vnggui
Hello,

In my code I need dynamically inject html code to load VLC player like:

Code: Select all

var child = jQuery('<div id="' + this.options.divId + '_objectdiv" class="objectdiv" style="position: absolute; display: block; width: 100%; height: 100%; top: 0px;">' + '<div id="' + this.options.playerId + '" style="display: block; width: 100%; height: 100%;">' + ' <OBJECT type="application/x-vlc-plugin" id="' + this.options.playerId + '_emb" ' + ' classid="CLSID:9BE31822-FDAD-461B-AD51-BE1D1C159921" width="400" height="300"> ' + ' <PARAM NAME=\"Src\" VALUE=\"http:\/\/10.51.51.73\/clients\/vlc\/VID_10212014.mp4\"> ' + ' <PARAM NAME=\"windowless\" VALUE=\"true\">' + ' </OBJECT>' + '</div></div> ' ).addClass('StreamPlayer'); this.$elem.append(child); ...
but during run time, in IE 9, it is always rendered as :

Code: Select all

<object style="left: 0px; top: 0px; [b][u]width: 0px; height: 0px;[/u][/b]" id="player_431_emb" classid="CLSID:9BE31822-FDAD-461B-AD51-BE1D1C159921" [b][u]width="0" [/u][/b]type="application/x-vlc-plugin"[b][u] height="0"[/u][/b]> <PARAM NAME="AutoLoop" VALUE="0"> <PARAM NAME="AutoPlay" VALUE="-1"> <PARAM NAME="Toolbar" VALUE="-1"> <PARAM NAME="ExtentWidth" VALUE="0"> <PARAM NAME="ExtentHeight" VALUE="0"> <PARAM NAME="MRL" VALUE="http://10.51.51.73/clients/vlc/VID_10212014.mp4"> <PARAM NAME="Visible" VALUE="-1"> <PARAM NAME="Volume" VALUE="50"> <PARAM NAME="StartTime" VALUE="0"> <PARAM NAME="BaseURL" VALUE="http://10.51.51.73/clients/demos/demo4/player/src/player.php?requestName=Stream&http://10.51.51.73/clients/vlc/VID_10212014.mp4"> <PARAM NAME="BackColor" VALUE="0"> <PARAM NAME="FullscreenEnabled" VALUE="-1"> <param name="Src" value="http://10.51.51.73/clients/vlc/VID_10212014.mp4"> <param name="windowless" value="true"> <param name="AutoPlay" value="True"> <param name="Visible" value="true"> </object>
Obvious it is invisible as the width and height are both 0.

Anywhere wrong?

Re: VLC <object> width are height aer rendered as 0

Posted: 24 Oct 2014 20:24
by vnggui
Update rendered object HTML snippet:

<object style="left: 0px; top: 0px; width: 0px; height: 0px;" id="player_431_emb" classid="CLSID:9BE31822-FDAD-461B-AD51-BE1D1C159921" width="0" type="application/x-vlc-plugin" height="0">
<PARAM NAME="AutoLoop" VALUE="0">
<PARAM NAME="AutoPlay" VALUE="-1">
<PARAM NAME="Toolbar" VALUE="-1">
<PARAM NAME="ExtentWidth" VALUE="0">
<PARAM NAME="ExtentHeight" VALUE="0">
<PARAM NAME="MRL" VALUE="http://10.51.51.73/clients/vlc/VID_10212014.mp4">
<PARAM NAME="Visible" VALUE="-1">
<PARAM NAME="Volume" VALUE="50">
<PARAM NAME="StartTime" VALUE="0">
<PARAM NAME="BaseURL" VALUE="http://10.51.51.73/clients/demos/demo4/ ... 212014.mp4">
<PARAM NAME="BackColor" VALUE="0">
<PARAM NAME="FullscreenEnabled" VALUE="-1">
<param name="Src" value="http://10.51.51.73/clients/vlc/VID_10212014.mp4">
<param name="windowless" value="true">
</object>

Re: VLC <object> width are height aer rendered as 0

Posted: 24 Oct 2014 20:58
by vnggui
found solution from https://forum.videolan.org/viewtopic.php?f=16&t=76274
for IE after VLCPlayer loaded, it need set this.VLCPlayer.style.height = '100%'; and this.VLCPlayer.style.width = '100%'