Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

How can I use Live DVR?


We are service live streaming on HLS.

We use Akamai Live Streaming Service.
We set 5 minutes in DVR Limit. (Akamai Live Streaming Settings)

We implement custom rewind(10s) function.
This button is exposed 2 minutes later.


Javascript code =============================
var currentPosition = player.getPosition();
var duration = player.getDuration();
var rewindPosition = currentPosition - 10;
var startPosition = duration;
player.seek(Math.max(rewindPosition, startPosition));

The JavaScript code works exactly on my PC browser.


Android code =============================
long currentPosition = player.getPosition();
long startPosition = player.getDuration();
long rewindPosition = Math.abs(startPosition - currentPosition) - 10 * 1000;
player.seek(rewindPosition);

The Android code works reasonably well. (9s, 10s, 11s)


IOS code =============================
let rewindPosition = abs(5 * 60 + self.player.playbackPosition.floatValue) - 10
self.player.seek(UInt(rewindPosition))

The IOS code works abnormally. (I do not know how many seconds.)


How can I fix this?

4 Community Answers

George

JW Player Support Agent  
0 rated :

Is this an iOS SDK question? I noticed you’re using self.player

ticu

User  
0 rated :

Yes this is iOS SDK question.

As you can see above I used self.player.

But seek function works abnormally.

wangbum.lee

User  
0 rated :

we use instance value in swift version like below.

self.player = JWPlayerController(config: config)

In this situation we wonder that our calculation for rewind position is correct and what is the reason that it operates against expectation.
Some sample code will help me.

thanks in advance

Daniel Berger

JW Player Support Agent  
0 rated :

Hi,

Thank you for the code example. I am able to reproduce this issue. I believe that there is a potential bug here. The reason being that since seek takes a UInt parameter, you cannot seek in the past. I will escalate this to our engineers or further review.

This question has received the maximum number of answers.