Activex, javascript, and streaming

All you've ever wanted to know about the ActiveX, Mozilla plugins, the web interface and various PHP extensions
d3athrow
New Cone
New Cone
Posts: 3
Joined: 21 Oct 2014 21:31

Activex, javascript, and streaming

Postby d3athrow » 21 Oct 2014 21:35

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.

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: Activex, javascript, and streaming

Postby da2424 » 22 Oct 2014 19:56

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; }

d3athrow
New Cone
New Cone
Posts: 3
Joined: 21 Oct 2014 21:31

Re: Activex, javascript, and streaming

Postby d3athrow » 23 Oct 2014 19:41

No dice.

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

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: Activex, javascript, and streaming

Postby da2424 » 23 Oct 2014 20:30

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.

d3athrow
New Cone
New Cone
Posts: 3
Joined: 21 Oct 2014 21:31

Re: Activex, javascript, and streaming

Postby d3athrow » 23 Oct 2014 22:55

I dont know then because i pasted it exactly as you gave me and it refuses to work

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: Activex, javascript, and streaming

Postby da2424 » 24 Oct 2014 13:09

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.

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

Re: Activex, javascript, and streaming

Postby vnggui » 27 Oct 2014 21:52

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?

da2424
Cone that earned his stripes
Cone that earned his stripes
Posts: 310
Joined: 16 Apr 2013 16:57

Re: Activex, javascript, and streaming

Postby da2424 » 28 Oct 2014 17:19

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. ;)


Return to “Web and scripting”

Who is online

Users browsing this forum: No registered users and 28 guests