Well, cue points would be my best hint but since you don't want them then I can really think of a one more solution. You need to add a listener that checks the current playing time of the video and compare it to the time when you want it to stop. Let's say you start the video and want it to stop after 10 seconds ( roughly ). When you start the video, you read the start position time 0:00 and increment it ( add to the value ) the amount of time after which you want it to stop ( let's say 10 seconds ). With an additional listener ( can't remember if you have something built in that can listen for video play progress but if you don't, then simply use a Timer ) you'll check the current video position ( the time that has elapsed ) and compare it to the stop time ( to 0:10 ) when the video's current position is equal to or bigger than the stop time then simply stop the video.
With best regards,
Thanks for your input. I really appreciate it.
If I understand what you are saying, that's a good idea if I want to play a piece from the beginning to a stopping point, but what if I want to play a section in the middle?
Also, if I have to use cue points, is there a way to add them to the video after it is loaded without having to add them through the encoder?
1 person found this helpful
If you want to play a section from the middle, you do exactly the same thing. But instead of adding 10 seconds to 0:00 you'll add to 2:34 ( or from wherever you want it to start ). You can also store the starting point, so in the end you'll have startPoint = 2:34 , endPoint = 2:44 and after all this is stored, then you can jump to minute 2:34 in the video and start listening for the endPoint from there.
You can use the seek() method provided by the NetStream object to jump to a certain time in the video.
For more info, read up here:
The method is exactly the same, just that before you set the startPoint and endPoint, you'll use the seek(); method to jump to the startPoint and start playing the video from there. Obviously, that's when you instantiate the listener that compares the current video position to the endPoint. Once the endPoint is reached, stop the video.
With best regards,
EDIT: adding cue points dynamically is possible just that it can get tricky. Read up on the links I provided because they cover most of this. Once you understand how to work with video, you can start solving the problem.
Thanks again. This is very helpful.