cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michal Mocny <mmo...@chromium.org>
Subject Re: Media class downloading whole streaming file on iOS before play?
Date Wed, 13 Nov 2013 19:31:36 GMT
And for what its worth, the exec bright is now async, so its likely that js
execution is not actually blocked, but rather safari remote inspector is
not showing output which the app UI thread blocked.

Try to console.log(new Date()) and see if that is actually reporting a gap.
 If we fix this to move the download off-the-ui thread you will need to
update your code to call mediaPlayer.play() from the success callback.


On Wed, Nov 13, 2013 at 2:29 PM, Michal Mocny <mmocny@chromium.org> wrote:

> Yes, there is a bug that the media download is happening on the main ui
> thread.  You should be seeing a native warning message (see
> https://issues.apache.org/jira/browse/CB-4133) about this.
>
> I've not found a bug filed specifically for this yet, so filed here:
> https://issues.apache.org/jira/browse/CB-5378
>
>
> On Wed, Nov 13, 2013 at 1:43 PM, Nick Burka <nick@silverorange.com> wrote:
>
>> I’ve been implementing a simple Media playback app. It looks something
>> like:
>>
>> console.log(’start');
>> mediaPlayer = new Media(
>>     uri_to_my_mp3_file,
>>     mediaSuccess,
>>     mediaError,
>>     mediaStatus);
>>
>> console.log(’end’);
>> mediaPlayer.play();
>>
>> When the JavaScript executes, it takes 20+ seconds between the ‘start’
>> and ‘end’ logs. Then when I seekTo() on the playing file, it’s virtually
>> instantaneous. I presume that the Media class is downloading the entire
>> file on instantiation?
>>
>> A few other people seem to have the same problem:
>>
>> http://stackoverflow.com/questions/19938383/phonegap-build-media-play-takes-a-long-time-to-start-playing
>>
>> http://community.phonegap.com/nitobi/topics/phone_gap_media_api_ios_slow_loading
>>
>> Any help would be much appreciated.
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message