Dev.MJ
Dev.MJ

Reputation: 95

How can I resume video at the middle of video stream?

In Documents, GCKRemoteMediaClient has play(), pause(). not resume() And play()'s description is "Playback always begins at the beginning of the stream."

So, How can I resume video at the middle of video stream? (I wanna pause -> resume)

setPlaybackrate also is not working..

In my custom class

func pause() {
    let request = castSession?.remoteMediaClient?.pause()
    request?.delegate = self

 // not work
 // let request = castSession?.remoteMediaClient?.setPlaybackRate(0)
 // request?.delegate = self
}

func play() {
    let request = castSession?.remoteMediaClient?.play()
    request?.delegate = self

    // not work
    // let request = castSession?.remoteMediaClient?.setPlaybackRate(1)
    // request?.delegate = self
}

Upvotes: 1

Views: 214

Answers (1)

Quang Dam
Quang Dam

Reputation: 325

Following the description of Cast SDK, you need call play(objective c) function and the video will be resumed. You can read more from this link.

If you want to resume your video from the middle of the video, you should use seek function to do that.

/** * Begins (or resumes) playback of the current media item. Playback always begins at the * beginning of the stream. The request will fail if there is no current media status. * * @return The GCKRequest object for tracking this request. */ - (GCKRequest *)play;

Upvotes: 1

Related Questions