[TIMOB-26436] iOS: VIdeoPlayer time in seconds
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Critical |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-10-19T18:41:03.000+0000 |
| Affected Version/s | Release 7.0.0 |
| Fix Version/s | Release 7.5.0 |
| Components | iOS |
| Labels | n/a |
| Reporter | Sergey Volkov |
| Assignee | Vijay Singh |
| Created | 2018-10-01T11:48:50.000+0000 |
| Updated | 2018-10-19T18:41:07.000+0000 |
Description
Since 7.0.0 VideoPlayer on iOS treats time in seconds instead of milliseconds.
Affected properties: "currentPlaybackTime", "duration" (probably also "playableDuration" and "endPlaybackTime"), events: "durationavailable".
Hello, Can you please provide a standalone code that displays the issue? Thanks.
In 7.0.0, we have moved from MPMoviePlayerController to latest api AVPlayerViewController given by apple. Which was a huge change. In that I guess we missed this. I'll look in this. Thanks for reporting!
bq. In 7.0.0, we have moved from MPMoviePlayerController to latest api AVPlayerViewController given by apple. Which was a huge change. In that I guess we missed this. I'll look in this. Thanks for reporting! Yeah, I've been watching TIMOB-19040 since 2016 :-) Also documentation on VideoPlayer is broken: you've labeled many properties as deprecated-removed, but they are still exists on Android. And there was no need to remove (even no need to rename) Titanium.Media.VIDEO_SCALING_* properties: new ones have same meaning as old before, but currently I have to use different values for iOS and Android (and new have "string" type, where old was "number"). It will be nice to have old "VIDEO_SCALING_*" back on iOS.
PR - https://github.com/appcelerator/titanium_mobile/pull/10373 Test Case (Time in log should be in milliseconds )-
var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var player = Ti.Media.createVideoPlayer({ url: 'http://techslides.com/demos/sample-videos/small.mp4', showsControls: false, autoplay: true, height: 200 }); win.add(player); function onDurationAvailable(e) { console.log(e.type, 'e.duration', e.duration); console.log('player.duration', e.source.duration); } player.addEventListener('durationavailable', onDurationAvailable); var i = 0; var interval = setInterval(function() { if (i++ > 10) { clearInterval(interval); } console.log(player.currentPlaybackTime); console.log('playableDuration is' +player.playableDuration); }, 500); win.open();[~s.volkov] For broken doc and Scaling property I will file a different ticket and will check what can be done. Or if you wish you can file a bug. I'll go from there. Thanks!
FR done.
Closing since FR was done.