Mobile

Jplayer is not working with HTC One Android 4.3 version browser

January 29, 2014 by Sarath DR in Mobile, Tips, Web Development with 0 Comments

There is an issue with jPlayer media load function which causes some problem in playing media files with some Android browsers. There is a fix already in place on JPlayer git repository ( click here ) but for some reason that does not work. The media load function raises an exception while audio/video element has been ready to play. Since the exception is not valid for android browser they are handling it with a try-catch.

Screen Shot 2014 01 29 at 17.10.16 300x143 Jplayer is not working  with HTC One Android 4.3 version browser

How ever it will not work unless there is a minor delay. So you can use the below code to fix this issue. (Added a 1 millisecond delay before calling media.load() )

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
 
 
setTimeout(function(){
 if(this.status.waitForLoad) {
   this.status.waitForLoad = false;
  try {
        this.htmlElement.media.load();
   } catch (e) {
      var isAndroid = /Android/i.test(navigator.userAgent); 
      if (!(e.code == DOMException.INVALID_STATE_ERR && isAndroid)) {
                                         throw e;
       }
     }                               
  }
},100);

You can download the fixed file from below.

Jplayer.js

Tagged , , ,

Share this to

Related Posts

Leave a reply

Your email address will not be published. Required fields are marked *

*

About
View Sarath D R's profile on LinkedIn

I am a technology consultant and an entrepreneur focused on the following technologies Java,Spring, Android, Angular, Asterisk, Symfony, Cake , Code-Igniter, Jquery , XAMPP, XHTML, AJAX, MySql, Seo, Web Design, Wordpress, iPhone development.

Today’s Tips
  • Generate Codova.jar file from Phonegap project using ant
  • Google map javascript client  to find the geographic co-ordinates  from  Address or post code
  • Update Android main UI from Webview – Phonegap Plugin
  • Jplayer is not working  with HTC One Android 4.3 version browser
  • Regular expression to validate mobile phone numbers starting with + ( plus ) – php
  • Simple pagination script for PHP
  • Useful adb ( Android Debug Bridge ) commands
  • Change the javascript files url to absolute url – Symfony 1.4
  • Set Http authentication header from Client – PHP / CURL

This site uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.This site also uses cookies from Google to deliver its services, to personalise ads and to analyse traffic. Information about your use of this site is shared with Google. By using this site, you agree to its use of cookies.

Close