cordova-plugin-media icon indicating copy to clipboard operation
cordova-plugin-media copied to clipboard

fix(android): avoid seeking on media without duration (CB-11314)

Open schoetty opened this issue 9 years ago • 3 comments
trafficstars

On Android >= 6.0, live streams do not start playing. This is because the onPrepared method of AudioPlayer invokes seekTo, what leads to an error because live streams have no duration and hence can not be seeked.

schoetty avatar May 24 '16 14:05 schoetty

Cordova CI Build has one or more failures.

Commit - Link Dashboard - Link

Builder Name Console Output Test Report Device Logs
Windows 8.1 Store Link Link Link
Windows 10 Store Link Link Link
Windows 8.1 Phone Link Link Link
iOS Link Link Link
Android Mac Link Link Link

cordova-qa avatar May 24 '16 16:05 cordova-qa

This is also a problem with MP3 files where android (for whatever reason) cannot read the duration of the file. This could be some slight corruption to the file over time or it could be simply an encoding format that android doesn't like. This is pretty well documented with people having to work around the same issue in native audioplayers that use the same underlying frameworks.

I went insane trying to figure out why iOS would seek within a local file but Android intermittently wouldn't.

I'm definitely going to give this PR a test!

ghenry22 avatar Jun 13 '16 00:06 ghenry22

There is a merge conflict now @schoetty. Could you maybe fix that please? Thanks.

janpio avatar Sep 16 '18 17:09 janpio