Page 1 of 1

IE (ActiveX) Plugin Fullscreen / VLC app setting

Posted: 13 Oct 2006 13:56
by tomakaze
There is one problem I notice with the 0.8.5 build of the Active X plugin, which possibly nobody has noticed, but maybe it has been fixed in a later release.

In the VLC app preferences, if you check the option "Fullscreen video output" it will automatically open fullscreen when VLC is loaded in a webpage. This is cool.

BUT, if you uncheck the box, the javascript fullscreen method no longer works! That is not cool, so now I am not using the fullscreen button anymore, but telling people to click the video picture for fullscreen. That works ok, but this is still a bug I would say.

Another thing I noticed in IE, is that all ActiveX plugins require clicking first to be controlled. If you click the VLC object however the picture goes black, so this doesn't help when going from Fullscreen and then back again.

I was able to work around IE taking control of ActiveX objects by writing the object via javascript when the page is loading, and then IE doesn't even notice it :)

Posted: 13 Oct 2006 15:10
by lagarazo
How do you "write the object via javascript when the page is loading"?

What does it solve?

Writing VLC object with Javascript to trick IE

Posted: 13 Oct 2006 15:24
by tomakaze
Like this... Otherwise IE detects the ActiveX object in the html and puts this yellow line around the object, saying click to activate. When you click it, the VLC picture goes black even though it keeps playing.

This is a new security "feature" of IE, which they introduced in July, but it really blows. It does the same thing with Flash and Windows Media Player, which is confusing since you can't interact with the object until you click it once. This javascript writing would be the key for anybody to write any object to IE, rather than displaying it inline with html.

I'd be surprised if nobody else noticed this problem, because it was pretty obvious when clicking the video to activate fullscreen.

Code: Select all

function loadObject() { var vlc_html = ''; vlc_html += '<OBJECT classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" width=480 height=360 id="vlc" events="True" VIEWASTEXT>'; vlc_html += '<param name="MRL" value="" />'; vlc_html += '<param name="ShowDisplay" value="True" />'; vlc_html += '<param name="AutoLoop" value="False" />'; vlc_html += '<param name="AutoPlay" value="False" />'; vlc_html += '<param name="Volume" value="50" />'; vlc_html += '</OBJECT>'; document.write(vlc_html); }
In the html, I just call this inline right where I want my VLC:

Code: Select all

<script language="Javascript">loadObject();</script>

Re: Writing VLC object with Javascript to trick IE

Posted: 30 Oct 2006 13:38
by zvona
I'd be surprised if nobody else noticed this problem, because it was pretty obvious when clicking the video to activate fullscreen.
I've currently struggling with this problem. Thank you for the loadObject() function you provided, albeit it didn't fix the problem in all test cases for IE6 / IE7.

If anyone is aware of an advanced solution, I'd highly appreciate of an example.

Posted: 30 Oct 2006 13:50
by tomakaze
You're welcome!

That is basically just a cheap trick for IE, discovered through trial and error. I haven't tested it in IE7 yet since I'm using mac usually, but it would be better if IE played a bit nicer, or at least if the vlc plugin could deal with being presented as a protected ActiveX object and then clicked on without losing the picture.

LoadObject trick

Posted: 01 Nov 2006 05:25
by Tappen
Microsoft had to cripple IE in this way because someone else (I forget who) owns the patent for the idea that you could put an object in a web page and have it automatically load and run.

Thank the software patent supporters.

Posted: 01 Nov 2006 08:08
by tomakaze
Well isn't that special! :idea:

Posted: 23 Nov 2006 12:57
by skytt
Hi guys,

I have a problem with the activate the active x object with realtime streaming. When I have the javascript that does that on, I get IE to crash maybe 40-50% of the time. I start the realtime streaming with a javascript function like this,

Code: Select all

function doGo() { var options = new Array(":input-repeat=0"); targetURL = 'http://xxx/axis-cgi/mjpg/video.cgi?resolution=560x420&compression=40&clock=1&date=1'; document.getElementById('vlc').addTarget(targetURL, options, 4+8, -666); }
I call this function after i have called the activate function.

If I just make a button or link with the call to the doGo function and not do that when the page is rendering it or turn off the activate x function everything works. But i need both functions so the stream doesnt stop when you want fullscreen.

Any help is appreciated
Robert

Posted: 24 Nov 2006 10:57
by zvona
I noticed the very same problem after installing 0.8.6. I installed back version 0.8.5 and now crashes are much more infrequent.

However the JS you're using is correct and should do the work.

Posted: 24 Nov 2006 11:14
by skytt
hi zvona,

I updated my vlc last night and that seems to have solved the problem for now.

Thank you for your answer.

/Robert

Posted: 01 Dec 2006 09:30
by Yapadavaro
Hi all,

First problem : Fullscreen

If you launch the activex like that, it works :

Code: Select all

var _options = new Array(":vout-filter=deinterlace", ":deinterlace-mode=linear", ":fullscreen=1"); document.vlc.addTarget(strToLoad, _options, 12, -666);
The activeX is launched in fullscreen.
To return in window mode, click 'f' or double click on the video.

The fullscreen have some problem with me to while using the fullscreen property, so I use this code :

Code: Select all

<input type="button" value="Fullscreen" onclick='var X = document.vlc.getVariable("key-fullscreen"); document.vlc.setVariable("key-pressed", X);'>
This method works fine.

For the activeX activation, i have browse the msdn site and found a very simple method :
the object must be declared in a outside file so :
Create a file.js with this code :

Code: Select all

document.write('<object '); document.write('classid="clsid:E23FE9C6-778E-49D4-B537-38FCDE4887D8" '); document.write('codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" '); document.write('width=640 height=480 '); document.write('name="vlc" events="True" VIEWASTEXT>>'); document.write('<param name="MRL" value="">'); document.write('<param name="ShowDisplay" value="False">'); document.write('<param name="AutoLoop" value="True">'); document.write('<param name="AutoPlay" value="False">'); document.write('<param name="AutoStart" value="False">'); document.write('<param name="Enable" value="False">'); document.write('<param name="Volume" value="100">'); document.write('</object>');
and call this file.js in your html page like this :

Code: Select all

<td> <script src="file.js"></script> </td>
You should never have to click on the video to activate it.

Hope this help.
Yap.