Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-1452

Media position incorrect after being set beyond duration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.0
    • 2.6.0
    • cordova-ios
    • None

    Description

      While playing a media file, set the position to be greater than the duration of the file using the media.seekTo() api. This will properly stop the playing of the media. However, the media.position is set to the value beyond the duration. The media can not be played again until media.stop is called.

      This can be reproduced in the mobile spec manual audio test:
      1) enter a value of 8 into the SeekBy/SeekTo input
      2) press play to start the audio playing
      3) press SeekBy button
      4) press SeekBy button again to make new position greater than the 18 second duration. The media will stop playing
      5) press the play button to play the media again - it will not play. You must first press stop to "officially" stop the media before it will play again.

      I'm not sure this is worth fixing since media will be overhauled.
      The fix is to set the currentTime to 0 in the mediaDidStopPlaying method. I also think that we should return a position of 0 from the seekToAudio method if the seekTo position is greater than the duration but I'm not sure what the other platforms are doing in this case. The other alternative is to return the requested position from seekToAudio (even if it is beyond the duration) and to set the MEDIA_POSITION to 0 from the mediaDidStopPlaying method.

      Attachments

        Activity

          People

            wjamesjong James Jong
            becka11y Becky Gibson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: