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

iOS: SDK 7.0.2.GA - VideoPlayer playback issues

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: Release 7.0.2
    • Fix Version/s: Release 7.3.0
    • Component/s: iOS
    • Labels:
    • Story Points:
      8
    • Sprint:
      2018 Sprint 06 SDK, 2018 Sprint 07 SDK, 2018 Sprint 08 SDK, 2018 Sprint 09 SDK, 2018 Sprint 10 SDK, 2018 Sprint 11 SDK

      Description

      on iOS titanium SDK 7.0.2.GA once the playback is done the media player fires the complete event (which is correct) and then the stop event (which shouldn't)

      also the function stop doesn't stop the playback but rather pauses it.

      and the durationavailable event is fired twice the second time an audio/video is played.

      // Some comments here
      var dataStructure = [{
        title : "Play video",
        action : playVideo
      }, {
        title : "Pause video",
        action : pauseVideo
      }, {
        title : "Stop video",
        action : stopVideo
      }, {
        title : "Change video source (local)",
        action : changeLocalVideoSource
      }, {
        title : "Change video source (remote)",
        action : changeRemoteImageSource
      }, {
        title : "Change background color",
        action : changeBackgroundColor
      }, {
        title : "Set volume to 50%",
        action : decreaseVolume
      }, {
        title : "Get playable duration",
        action : getPlayableDuration
      }, {
        title : "Get playback state",
        action : getPlaybackState
      }, {
        title : "Set full width",
        action : setSizeFullWidth
      }, {
        title : "Set width + height to 300 (animated)",
        action : setSize
      }, {
        title : "Is playing?",
        action : getPlaying
      }, {
        title: "Take screenshot at 5s",
        action: takeScreenshot
      }, {
        title: "Take multiple screenshots",
        action: captureSeriesOfImages
      }, {
        title: "Set initial playback time",
        action: setInitialPlaybackTime
      }, {
        title: "Is airPlay allowed?",
        action: getAllowsAirPlay
      }, {
        title: "repeatMode ?",
        action: getRepeatMode
      }];
       
       
      var counter = 0;
       
      /* -- UI -- */
       
      var isiOS = (Ti.Platform.osname == "ipad" || Ti.Platform.osname == "iphone");
       
      var win = Titanium.UI.createWindow({
        title : 'Video Player Demo',
        backgroundColor : '#fff',
        layout : 'vertical'
      });
       
      var nav = isiOS ? Ti.UI.iOS.createNavigationWindow({
        window : win
      }) : null;
       
      var header = Ti.UI.createView({
        height : 350,
        backgroundColor : "#eee"
      });
       
      var content = Ti.UI.createScrollView({
        layout : "horizontal",
        scrollType : "vertical",
        contentWidth : Ti.Platform.displayCaps.platformWidth,
        contentHeight : 1000
      });
       
      var videoPlayer = Titanium.Media.createVideoPlayer({
        autoplay : true,
        url : 'http://techslides.com/demos/sample-videos/small.mp4',//'movie.mp4',
        initialPlaybackTime: 1000,
        showsControls:true,
        pictureInPictureEnabled : true, // Only supported on iOS9 & iPad Air or later!
        scalingMode : Titanium.Media.VIDEO_SCALING_MODE_RESIZE_ASPECT,
        repeatMode : Titanium.Media.VIDEO_REPEAT_MODE_NONE
      });
       
      for (var i = 0; i < dataStructure.length; i++) {
        var btn = Ti.UI.createButton({
          top : '3.5%',
          left : '7%',
          height : 60,
          width : '40%',
          tintColor : '#b50d00',
          backgroundColor : '#e0e0e0',
          title : dataStructure[i].title
        });
       
        btn.addEventListener("click", dataStructure[i].action);
       
        content.add(btn);
      }
       
      header.add(videoPlayer);
      win.add(header);
      win.add(content);
       
      if (nav) {
        nav.open();
      } else {
        win.open();
      }
       
      /* -- Events -- */
       
      videoPlayer.addEventListener('complete', function(e) {
        Ti.API.info('complete ' + JSON.stringify(e));
      });
       
      videoPlayer.addEventListener('durationavailable', function(e) {
        Ti.API.info('durationavailable ' + JSON.stringify(e));
      });
       
      videoPlayer.addEventListener('error', function(e) {
        Ti.API.info('error ' + JSON.stringify(e));
      });
       
      videoPlayer.addEventListener('load', function(e) {
        Ti.API.info('load ' + JSON.stringify(e));
      });
       
      videoPlayer.addEventListener('playbackstate', function(e) {
        Ti.API.info('playbackstate ' + JSON.stringify(e));
      });
       
      videoPlayer.addEventListener('playing', function(e) {
        Ti.API.info('playing ' + JSON.stringify(e));
      });
       
      videoPlayer.addEventListener('preload', function(e) {
        Ti.API.info('preload ' + JSON.stringify(e));
      });
      

        Attachments

          Activity

            People

            • Assignee:
              vijaysingh Vijay Singh
              Reporter:
              horozco Henry Orozco
              Reviewer:
              Hans Knöchel
              Tester:
              Samir Mohammed
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code