How to detect the end of a video?
Posted: Thu May 09, 2013 10:37 am
I create a native video player in code and give it a path to a video on the camera roll (using the mergAV external). Then via a transparent button over the screen I can either use the button to toggle pause and play, or set it to stop the video. When I stop it this way, my code deletes the player and returns to another card. So far so good.
The problem is that when the video ends naturally it just hangs on the last image and I want it do the same as when it is stopped as above. And I can't work out how to accomplish that small task. I thought I may be able to obtain the duration from a mobileControlGet property, and use a Send message based on that time, but both playableDuration and endTime return zero.
So how can I determine when a video ends naturally?
TIA
Don
The problem is that when the video ends naturally it just hangs on the last image and I want it do the same as when it is stopped as above. And I can't work out how to accomplish that small task. I thought I may be able to obtain the duration from a mobileControlGet property, and use a Send message based on that time, but both playableDuration and endTime return zero.
So how can I determine when a video ends naturally?
TIA
Don