Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26436] iOS: VIdeoPlayer time in seconds

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2018-10-19T18:41:03.000+0000
Affected Version/sRelease 7.0.0
Fix Version/sRelease 7.5.0
ComponentsiOS
Labelsn/a
ReporterSergey Volkov
AssigneeVijay Singh
Created2018-10-01T11:48:50.000+0000
Updated2018-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".

Comments

  1. Sharif AbuDarda 2018-10-02

    Hello, Can you please provide a standalone code that displays the issue? Thanks.
  2. Sergey Volkov 2018-10-03

  3. Vijay Singh 2018-10-04

    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!
  4. Sergey Volkov 2018-10-05

    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.
  5. Vijay Singh 2018-10-08

    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();
       
  6. Vijay Singh 2018-10-08

    [~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!
  7. Keerthi Mahalingam 2018-10-09

    FR done.
  8. Christopher Williams 2018-10-12

    Closing since FR was done.

JSON Source