Page 1 of 1

Activex, javascript, and streaming

Posted: 21 Oct 2014 21:35
by d3athrow
Ive got a video game that has a music streaming system that uses WMP and a hidden IE window and i'm trying to convert it to VLC for various reasons. This is what i have so far

Code: Select all

<object id='player' classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab"></object> <script> function noErrorMessages () { return true; } window.onerror = noErrorMessages; function SetMusic(url, time, volume) { var player = document.getElementById('player'); player.target = url; player.input.time = time; player.audio.volume = volume; } </script>
Now the initial song will play but trying to alter it after that results in no change.

Re: Activex, javascript, and streaming

Posted: 22 Oct 2014 19:56
by da2424
Try it with this code, I think it should work:

Code: Select all

function SetMusic(url, time, volume) { var player = document.getElementById('player'); player.playlist.items.clear(); player.playlist.add(url); player.playlist.playItem(0); player.input.time = time; player.audio.volume = volume; }

Re: Activex, javascript, and streaming

Posted: 23 Oct 2014 19:41
by d3athrow
No dice.

edit: to be specific trying to set the input.time results in no change. It just starts the song from the beginning.

Re: Activex, javascript, and streaming

Posted: 23 Oct 2014 20:30
by da2424
edit: to be specific trying to set the input.time results in no change. It just starts the song from the beginning.
Works fine for me with my fix, for example the value 60000 rewinds to 1min 0sek.
And an external command, like document.getElementById('player').input.time = 80000 works fine, too, while a file is playing.

Re: Activex, javascript, and streaming

Posted: 23 Oct 2014 22:55
by d3athrow
I dont know then because i pasted it exactly as you gave me and it refuses to work

Re: Activex, javascript, and streaming

Posted: 24 Oct 2014 13:09
by da2424
Strange.

I have tested it with this code:

Code: Select all

<!DOCTYPE html> <html> <head> <title>Test</title> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> </head> <body> <object id='player' classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://download.videolan.org/pub/videolan/vlc/last/win32/axvlc.cab"></object> <script type="text/javascript"> function noErrorMessages () { return true; } window.onerror = noErrorMessages; function SetMusic(url, time, volume) { var player = document.getElementById('player'); player.playlist.items.clear(); player.playlist.add(url); player.playlist.playItem(0); player.input.time = time; player.audio.volume = volume; } </script> </body> </html>
I don't know where you call SetMusic(), I have tested it in the Developer Console of the Browser.

Re: Activex, javascript, and streaming

Posted: 27 Oct 2014 21:52
by vnggui
A little doubt: put http://download.videolan.org/pub/videol ... /axvlc.cab browser address bar, result to "404 Not found", why still set codebase to there?

Re: Activex, javascript, and streaming

Posted: 28 Oct 2014 17:19
by da2424
A little doubt: put http://download.videolan.org/pub/videol ... /axvlc.cab browser address bar, result to "404 Not found", why still set codebase to there?
You're right, this file was not built for a long time, see https://forum.videolan.org/viewtopic.php?f=16&t=97518.

But you don't need the codebase attribute, the plugin works fine without this attribute, if you have installed VLC. And finally, this attribute is officially not supported in HTML5. ;)