Hi,
I have a music (4 minutes) that I want to add a slider that changes the timeline playback position.
I could get the timeline position and make the slider move accordingly, but I calculated the milliseconds by hand.
[SerializeField]
private Slider lengthSlider;
private void Update()
{
myTimelinePosition();
}
public void myTimelinePosition()
{
EventInstance.getTimelinePosition(out int position);
lengthSlider.value = position;
}
I have 2 questions:
-
Is it possible to get the length of a timeline or a region automatically?
-
Is it possible to change via slider in Unity the positioning of the play head and continue the music from that new position? Like we do when watching a video in youtube. We see the progress bar and click on the bar to move to a different part of the video/music.
Thanks!!!