AVPlayerViewController: Scrubbing to the very beginning of a live event stream seeks a not longer seekable position

Originator:dcorderoramirez
Number:rdar://31271447 Date Originated:27-Mar-2017 02:36 PM
Status:Open Resolved:
Product:tvOS + SDK Product Version:tvOS 10.2
Classification: Reproducible:Always
 
Area:
AV Playback

Summary:
When scrubbing to the very beginning of a live event stream, AVPlayerViewController tries to seek a non seekable position.

Steps to Reproduce:

A project reproducing the problem can be found here https://github.com/dcordero/Radar-31271447

Scrubbing to the very begining fails. The result is seeking back to live or in case of waiting for a longer time getting a frozen player.

You will get a trace "Seeking a not longer seekable position" in the console coming from the following code in ViewController.swift which probes that the targetTime is lower than the first seekable time.

    func playerViewController(_ playerViewController: AVPlayerViewController, timeToSeekAfterUserNavigatedFrom oldTime: CMTime, to targetTime: CMTime) -> CMTime {

        if let firstSeekableRange = playerViewController.player?.currentItem?.seekableTimeRanges.first?.timeRangeValue {

            if targetTime < firstSeekableRange.start {
                print("Seeking a not longer seekable position")
            }
        }

        return targetTime
    }

Expected Results:
Scrubbing to the very beginning plays the content from the begining of the available window


Actual Results:
 The result is seeking back to live or in case of waiting for a longer time getting a frozen player.


Version:
tvOS 10.2

Notes:


Configuration:
AppleTv 4th Generation

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!