VLC <object> width are height aer rendered as 0

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
vnggui
Blank Cone
Blank Cone
Posts: 15
Joined: 22 Oct 2014 18:50

VLC <object> width are height aer rendered as 0

Postby vnggui » 24 Oct 2014 20:19

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?

vnggui
Blank Cone
Blank Cone
Posts: 15
Joined: 22 Oct 2014 18:50

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

Postby vnggui » 24 Oct 2014 20:24

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>

vnggui
Blank Cone
Blank Cone
Posts: 15
Joined: 22 Oct 2014 18:50

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

Postby vnggui » 24 Oct 2014 20:58

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%'


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 50 guests