Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25640

iOS: Ti.Media.VideoPlayer "playbackState" constants are undefined

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 7.0.0
    • Fix Version/s: Release 7.0.2
    • Component/s: iOS
    • Labels:
    • Environment:

      iOS,VideoPlayer,playbackstate

    • Sprint:
      2018 Sprint 01 SDK

      Description

      Hello,

      In iOS on SDK 7.0.0+, the playbackState constants are `undefined` (http://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media.VideoPlayer-property-playbackState).

      • Ti.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED
      • Ti.Media.VIDEO_PLAYBACK_STATE_PAUSED
      • Ti.Media.VIDEO_PLAYBACK_STATE_PLAYING
      • Ti.Media.VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD
      • Ti.Media.VIDEO_PLAYBACK_STATE_SEEKING_FORWARD
      • Ti.Media.VIDEO_PLAYBACK_STATE_STOPPED

      Testing Environment:
      Appcelerator Command-Line Interface, version 7.0.1
      SDK: 7.0.1.GA
      iOS simulator: iPhone 7

      Test Code:

      var vidWin = Titanium.UI.createWindow({
          title : 'Video View Demo',
          backgroundColor : '#fff'
      });
       
      var videoPlayer = Titanium.Media.createVideoPlayer({
          top : 2,
          autoplay : true,
          backgroundColor : 'blue',
          height : 300,
          width : 300,
          mediaControlStyle : Titanium.Media.VIDEO_CONTROL_DEFAULT,
          scalingMode : Titanium.Media.VIDEO_SCALING_ASPECT_FIT
      });
       
      // Log raw-values of constants
      Ti.API.info('Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED ' + Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED);
      Ti.API.info('Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING ' + Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING);
      Ti.API.info('Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED ' + Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED);
       
      videoPlayer.url = 'video.mp4';
      vidWin.add(videoPlayer);
      videoPlayer.addEventListener('playbackstate', function() {
       
        var message = 'Unknown';
        switch (videoPlayer.playbackState) {
          case Ti.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED:
          message = 'Interrupted';
          break;
          case Ti.Media.VIDEO_PLAYBACK_STATE_PLAYING:
          message = 'Playing';
          break;
          case Ti.Media.VIDEO_PLAYBACK_STATE_PAUSED:
          message = 'Paused';
          break;
          case Ti.Media.VIDEO_PLAYBACK_STATE_STOPPED:
          message = 'Stopped';
        }
        
        Ti.API.info(message);    
      });
       
      vidWin.open();
      

      Test Results:

      [INFO] :   Titanium.Media.VIDEO_PLAYBACK_STATE_INTERRUPTED undefined
      [INFO] :   Titanium.Media.VIDEO_PLAYBACK_STATE_PLAYING undefined
      [INFO] :   Titanium.Media.VIDEO_PLAYBACK_STATE_SEEKING_BACKWARD undefined
      [INFO] :   Titanium.Media.VIDEO_PLAYBACK_STATE_SEEKING_FORWARD undefined
      [INFO] :   Titanium.Media.VIDEO_PLAYBACK_STATE_STOPPED undefined
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                hknoechel Hans Knöchel
                Reporter:
                mrahman Mostafizur Rahman
                Reviewer:
                Vijay Singh
                Tester:
                Abir Mukherjee
              • Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Backbone Issue Sync

                  • Titanium SDK/CLI <> Titanium Mobile
                    Synced with:
                    TIMOB-6072
                    Sync status:
                    ERROR
                    Last received:
                    Last sent:

                    Git Source Code