Skip navigation.

miscoded

the web is a hack

can you help exercise the compatibility skeleton?

, ,

A while ago I called Windows Media Player a skeleton in the compatibility closet.

The problem is that WMP comes in two flavours, one all-singing, all-dancing ActiveX version which supports the latest and greates in JavaScript interaction, and one Netscape Plugin API version which has a somewhat more limited and definitely very different repertory of JavaScript commands. Of course most sites wanting to display WMP video and interact with it with JavaScript are written for the ActiveX version, and naturally browsers that do not support ActiveX run into a lot of broken pages because of this.

Now, here's an experimental compatibility layer for WMP ActiveX scripting, implementing some of the ActiveX version's API in User JS, and I would very much appreciate your help testing it:

http://files.myopera.com/hallvors/files/1wmp.js

Please install it as a User JS and go surfing for video sites (you need Java installed too for it to work). Please leave a comment on this post when you start using it, giving your WMP version. Also report in the comments any broken sites, as well as ones that are broken without the user script but works with it. (Ignore video.aol.com because there seems to be a lot more work to do to get that fish working.) Also be sure to report any stability issues.

A good place to test is here:
http://www.thesun.co.uk/article/0,,11021-10043,00.html
Video should not work in a normal Opera but work if the User JS is active.

Thanks in advance!

Edit: note that the user script requires Opera 9.20 or greater.

new adventures in date parsingit's Y! time again

Comments

graste 15. April 2007, 02:09

Well, in my case, Opera just crashed without any message, when I entered the site with the user javascript in my userjs directory. Without the script the page just didn't display the video. I'm using Opera 9.20 on Windows XP.

BtEO 15. April 2007, 03:13

Windows XP & WMP 11 & Opera 9.20

The Sun worked fine aside from the video resizing issue that WMP 11 introduced, which is wholly separate from the terrible lack of scripting support.

Good work so far.

burnout426 15. April 2007, 07:30

Typo on line 73 (heigth -> height )

hallvors 15. April 2007, 08:53

Graste: wmp seems unstable sometimes :frown: but what wmp version do you use?

Joseaa 15. April 2007, 09:55

Sun works fine here using WMP 9 series.

F-V 15. April 2007, 14:20

Windows XP, Opera 9.20, WMP 10.

Sun page doesn't do anything, with or without the script.
Firefox works fine, apparently with the same plug-in.

hartley231 15. April 2007, 17:41

I can get the WMP plugin loaded on http://bigpondguide.com/07r3sydbrisq4_1 but it doesn't play any content. Further than I've ever gotten before. Windows XP running 9.20. It would be fantastic to get this working! Thanks, Michael

el_esponjoso 15. April 2007, 19:32

In TheSun's page of above, it doesn´t happen anything, doesn´t load any video (et. al. windows media plugin), only shows the video controls of the page, nothing more, in both cases: identifying as Opera or simulating to be Internet Explorer
I have Windows xp and windows media player 9
:frown: :frown: :frown: :frown: :frown:

hallvors 15. April 2007, 21:38

To those of you who do not see video on The Sun when the user JS is installed: could you PM me with the contents of your Error Console?

- Go to "Tools > Advanced > Error console"
- Click first line (well, if you've had a long session preferably the first line related to the Sun site)
- Press shift and click last line. All content should be selected
- Ctrl+C to copy
- Paste in a PM to me

Asle 16. April 2007, 21:19

With the script, Opera crashes every time on The Sun.
Opera 9.20, WMP 11, Windows XP home SP2.

xErath 16. April 2007, 23:38

For
http://on10.net/Blogs/tina/out-with-wpfe-in-with-microsoft-silverlight-this-has-just-been-announced/

You need this
fix-atlas-crap.js

Then I get these errors and messages
JavaScript
Unknown thread
looking for objects, found 1
JavaScript
Unknown thread
patching NPDS.npDSJavaPeer@1cac6db
JavaScript
Unknown thread
plugin event on <OBJECT height="225" width="300" class type="application/x-mplayer2"><PARAM name="url" value="http://on10.net/videos/Silverlight_on10.asx"><PARAM name="autostart" value="false"><PARAM name="uiMode" value="none"><PARAM name="enabled" value="true"></OBJECT>
JavaScript
Unknown thread
Attaching script to <OBJECT height="225" width="300" class type="application/x-mplayer2"><PARAM name="url" value="http://on10.net/videos/Silverlight_on10.asx"><PARAM name="autostart" value="false"><PARAM name="uiMode" value="none"><PARAM name="enabled" value="true"></OBJECT>
JavaScript
Unknown thread
new value for mute, false, old: undefined
JavaScript
Unknown thread
new value for volume, 100, old: undefined
JavaScript
Unknown thread
new value for playstate, 6, old: undefined
JavaScript - http://on10.net/Blogs/tina/out-with-wpfe-in-with-microsoft-silverlight-this-has-just-been-announced/
Timeout thread: delay 800 ms
Error:
name: TypeError
message: Statement on line 49: Type mismatch (usually a non-object value used where an object is required)
Backtrace:
Line 49 of User JS script
currentValue = compatMap[param][0]();
At unknown location
[statement source code not available]

Luchio 18. April 2007, 13:16

Saw this today:

New Release of Windows Media Player Plug-in for Firefox
http://port25.technet.com/archive/2007/04/16/windows-media-player-plug-in-for-firefox.aspx

I have not tried it since I'm not on my computer. I think it might be of interest to you.

NoteMe 19. April 2007, 07:15

i tried it on my computer yesterday at home. But I don't have 9.2 there, just the beta.

Opera found the plugin, and it correctly showed the MIME types supported on opera:plugins, but there was no picture, only sound.

At home I have Win XP SP2 and WMP 11. It worked in Fx2, so I guess this is the reason why they call it the Firefox plug-in. They probably knew it didn't work in other Netscape Gecko plug-in compatible browsers.

Or am I wrong, and someone else made it work?

- ØØ -

Smir 19. April 2007, 17:55

It's very nice!

Some courses of my university record the lecture and the slides and use a system, where you can watch the slides online with the lecture.
One example:
http://a7msstorage1.igd.fhg.de/WebVenue/lectures/bv2007/2007-04-18/web_template/Flash.html

It consists of a mix of two Flash objects and one media player object... but it did not work correctly in Opera.

With this user JS and some small adjustments I was able to view the lecture and the slides changed automatically during the lecture.
But it is still not possible to jump to a specific slide, because changing of controls.currentPosition does not work.
(Is there any setCurrentPosition function or something like that? Is there any good resource which specifies all functions for the Netscape type wmp Plugin?)


My Adjustments to the User JS:
I changed
if( e.element.type&&e.element.type.toLowerCase()=='application/x-mplayer2' ) {
to
if( e.element.getAttribute && e.element.getAttribute("type") && e.element.getAttribute("type").toLowerCase()=='application/x-mplayer2' ) {

Somehow it did not work without this change...

Another change was to the page itself.
It defines an Object with id Player and an embed with name Player but the JS only works with document.getElementById("Player").
I gave the embed the id Player and the object the id PlayerIE.

hallvors 21. April 2007, 00:30

Luchio: that's pretty exciting, I hope that plugin will be developed and properly tested, and that it will work in Opera.

I hope those who see crashing can give me their Java version too.

Smir: I've uploaded a small update that includes your fixes and then some. The site seems to work fine now :smile:

Big pond: sorry, I haven't gotten to the bottom of it yet (no pun intended.. p:). It looks like they use some script commands and playlists, if those features are absolutely necessary I doubt we can make it work. The script stops with an error on trying to access a frame that for some reason doesn't exist.

And I'll investigate some ON10 fixes later, thanks xErath.

Niiso 29. April 2007, 10:08

where do i get sun from

hallvors 3. May 2007, 10:17

You can download Sun Java Runtime Environment from http://www.java.com/

Niiso 3. May 2007, 13:57

thanks

How to use Quote function:

  1. Select some text
  2. Click on the Quote link

Write a comment

Comment
(BBcode and HTML is turned off for anonymous user comments.)

If you can't read the words, press the small reload icon.


Smilies