Prepare() in video, how does it work?

I have my video here and isPrepared is always false. I put Prepare in Start function, in onEnable function, Update Method… I don’t know what to do with this prepare thing?!

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Video;

public class SliderVideo : MonoBehaviour
{
    [SerializeField] VideoPlayer video;
    [SerializeField] Slider videoSlider;
    [SerializeField] string videoName;

    double videoTimeCache;
    bool play;

    bool isDone;
    public bool IsPlaying
    {
        get { return video.isPlaying; }
    }

    public bool isLooping
    {
        get { return video.isLooping; }
    }
    public bool IsPrepared
    {
        get { return video.isPrepared; }
    }

    public bool IsDone
    {
        get { return isDone; }
    }

    public double Time
    {
        get { return video.time; }
    }

    public ulong Duration
    {
        get{ return (ulong)(video.frameCount/video.frameRate); }
    }

    public double NTime
    {
        get { return Time / Duration; }
    }

    //Start

    private void Start()
    {
        LoadVideo(videoName); //Prepare();
    }

    //Update

    private void Update()
    {
        if (!IsPrepared) return;

        videoSlider.value = (float)NTime;
    }

    //Prepare Method

    public void LoadVideo(string name)
    {
        video.url = System.IO.Path.Combine(Application.streamingAssetsPath, name+".mp4");
        video.Prepare();
        if (video.isPrepared)print(IsPrepared);
    }

    //Methods for Buttons

    public void PlayVideo()
    {
        if (!IsPrepared) return ;
        video.Play();
    }

    public void PauseVideo()
    {
        if (!IsPlaying) return;
        video.Pause();
    }

    public void RestartVideo()
    {
        if (!IsPrepared) return ;
        PauseVideo();
        Seek(0);
    }

    public void Seek(float nTime)
    {
        if(!IsPrepared) return ;
        nTime = Mathf.Clamp01(nTime);
        video.time = nTime * Duration;
    }

    public void SeekSlider()
    {
        video.time = (videoSlider.value * Duration);
    }
}

Prepare is preparing the video for playback. Use the prepareCompleted event to play the video (or have some UI change for a Play button that’ll call the Play() method.

In your update loop, whilst it is prepared you’re setting the value of the video slider to the time of the video player.
However, if you’ve got the OnValueChanged hooked up to the Seek method it’ll constantly seek every frame.
Use the SetValueWithoutNotify of the slider instead.

There is an event to subscribe to for when the prepare has completed. Might need to hook into it.
Also, make sure your path is correct to your video if prepare never completes.