jplayer / jPlayer

jPlayer : HTML5 Audio & Video for jQuery
http://jplayer.org/
Other
4.6k stars 1.47k forks source link

jPlayer does not play after AJAX call On Android 4.1> #276

Closed devknown closed 9 years ago

devknown commented 9 years ago

i'm using this but not working on android 4.1> vol = getVolume(); $.ajax( { url : "post.php?stream=true", type: "POST", data : "id="+id, cache: false, success: function(data) { $("#main-player").jPlayer({ ready: function () { $(this).jPlayer("setMedia", { mp3: data }).jPlayer("play"); }, swfPath: "/template/js", supplied: "mp3", wmode: "window", smoothPlayBar: true, keyEnabled: true, remainingDuration: true, toggleDuration: true, volume: vol }); } });

thepag commented 9 years ago

First of all, you cannot set the volume in android, so don't bother. The same goes for iOS. But it does not harm, so I imagine you want it for desktop and other browsers.

The .jPlayer("play") will be causing the problem. Remove it. It does nothing on Android, oh except as you have fount it kills the Android audio element. So again, remove it. Android was poor with html5 audio until very recently, so make sure you have an up to date version of jPlayer. It has been a minefield lately with the last few Android updates.

devknown commented 9 years ago

yes i have the last Version 2.9.1 IF i remove .jPlayer("play") how can i use "autoplay" and Thanks.

thepag commented 9 years ago

You cannot auto play on mobile devices. Do not try. Trying is what causes your problem on Android and its quality Audio element.

devknown commented 9 years ago

OK Thanks for reply - & autoplay it's working fine on android 2.3.6 & in rooted device on android 4.2.2