Search code examples
iosobjective-cmacoslibvlc

VLCKit: VLCMediaPlayer move to time


I want to scroll a video to a specific time. For example I have an one minute video with a slider and I want to change the playing position.

- (IBAction)itemSlider:(UISlider *)sender withEvent:(UIEvent*)event
{
    if ([event.allTouches anyObject].phase == UITouchPhaseEnded)
    {
        VLCTime *newTime = [VLCTime timeWithNumber:@(sender.value/1000)]; //convert milliseconds to seconds

        [mediaplayer.media setLength:newTime]; //tried to set time
    }
}

Any ideas?


Solution

  • New time I must set to all mediaplayer player object, not only to media object.

    [mediaplayer setTime:newTime];