jplayer javascript error (SCRIPT16385: Not implemented) in some versions of IE

1,759 views
Skip to first unread message

Tim Regan-Porter

unread,
Jul 20, 2011, 12:17:15 PM7/20/11
to jpl...@googlegroups.com
I was trying to setup my site on a monitoring service called AlertFox, which uses VMs and iMacros to do automated monitoring via actual browsers. And key parts of the site were not working. I tracked down the error to the jplayer javascript, and found that the jplayer.org site has the sample problem.

The IE9 script console is reporting this problem on page load:
  
  SCRIPT16385: Not implemented
  jquery.jplayer.js, line 482 character 5

which references this line:
  self.html.canPlay[format] = self.html[self.format[format].media].available && "" !== self.htmlElement[self.format[format].media].canPlayType(self.format[format].codec);

I can replicate it on jplayer.org and on my production and development sites. 

This is a problem that may be particular to IE9 on Windows Server 2008; I haven't been able to replicate it on my Windows 7 VM using either IE8 or IE9. But the AlertFox people looked at it on multiple VMs and replicated the problem. They are running WindowsServer2008, Version 6, and the latest IE9.

I would greatly appreciate it if someone could look at this and suggest a solution/workaround.

Thanks.

Mark Panaghiston

unread,
Jul 20, 2011, 4:57:33 PM7/20/11
to jpl...@googlegroups.com
You are not the first to report problems on Windows Server 2008. Although, I do not remember such nice details before.

The bit that I believe is causing the problem is the mediaElement.canPlayType(codec).

The solution.available part already checks that canPlayType is a property of the media element. This would imply that the property exists, but it is... "Not Implemented" as the error reports.

I cannot test this myself as I do not have access to that OS. Basically, you'd want to create a media element, say a video one, and then do an alert(video.canPlayType("audio/mpeg")) and see if it throws the same error.

Slap this in a clean HTML page in a <script> tag:

var video = document.createElement('video');
alert(video.canPlayType("audio/mpeg"));

The alert should say "Maybe" on IE9... It could say "Probably", but I believe that only happens if you also give the codec details.

If that little bit of code causes the same error, then we may have found the problem.

Tim Regan-Porter

unread,
Jul 21, 2011, 4:02:33 PM7/21/11
to jpl...@googlegroups.com
We have found the problem. That simple call results in "Object doesn't support property or method 'canPlayType'."

And I found a discussion on Modernizr github about this: https://github.com/Modernizr/Modernizr/issues/224. It's a documented issue with Microsoft.

Annoying, but at least it should be easy to suppress the error.

Mark Panaghiston

unread,
Jul 21, 2011, 7:52:31 PM7/21/11
to jpl...@googlegroups.com
Suppose I could wrap it in a try/catch so that IE does not through the error.

It is shocking that the media property exists at all if they did not implement it correctly.

var ie9hasIssues = false;
try {
  media.canPlayType("audio/mpeg");
} catch(err) {
  ie9hasIssues = true; // On Win Server 2008
}

The problem should really affect the state of the solution 'available' property that I use in jPlayer... So that everything else simply pans out... And the Flash is used on IE9 Win Server 2008.

Mark Panaghiston

unread,
Aug 4, 2011, 11:04:57 PM8/4/11
to jpl...@googlegroups.com
Just to let you know that I will be fixing this problem. I try and keep each update contained, so I will look at this and a few other bugs that have cropped up after I complete this current one.

Mark Panaghiston

unread,
Aug 6, 2011, 12:01:12 AM8/6/11
to jpl...@googlegroups.com
Fixed in jPlayer 2.0.25

Mark Panaghiston

unread,
Aug 10, 2011, 10:29:55 AM8/10/11
to jpl...@googlegroups.com
Tim,

Would you please check jPlayer 2.0.32 and report back on whether this problem still exists.
http://jplayer.org/2.0.32/demos/

Others have been reporting problems like this in IE9 for some time. It appears that some peoples Windows 7 IE9 has the same problem. See this thread:
https://groups.google.com/d/topic/jplayer/knAxCsT2IKk/discussion


Best regards,
Mark P.

Tim Regan-Porter

unread,
Aug 12, 2011, 3:35:04 PM8/12/11
to jpl...@googlegroups.com
Mark,

Unfortunately, I can't test this anymore. Even though I worked around the issue, I reported to the company hosting the monitoring service that Windows Server 2008 had this problem if they didn't install Desktop Experience first (the problem apparently only crops up on Server when this is not done). I suggested that some of their clients might need their HTML5 solutions to be monitored, so they add this to all of their servers.

However, I did put in my fix before that and can verify that it worked. My solution was almost the same as the code fragment you posted above. Here's the heart of my hack:

      function try_can_play(element, type) {
        var can_play = false;
        try {
          can_play = element.canPlayType(type);
        } catch(err) { }
        return !!can_play;
      }

So you should be good to go.

-Tim

Mark Panaghiston

unread,
Aug 12, 2011, 5:41:40 PM8/12/11
to jpl...@googlegroups.com
Cheers Tim.
Reply all
Reply to author
Forward
0 new messages