I need to play videos stored on a web server from a web browser.
I was thinking of using Flash to achieve this. I found this article http://www.republicofcode.com/tutorials/flash/video_flvplayback/
Is there a better approach? Also when the video is playing or is paused, I'd like to be able to read the current time of playback from the browser (I guess through Javascript). Would Javascript be able to retrieve this time from the flash player?
Thanks and regards, Krt_Malta
No, no and no. Flash is the worst way to embed videos in websites, as the plugin creates speed and security drawbacks. Try using the HTML <video> tag, which embeds video without the need for any plugin. The syntax is as follows:
<video width="..." height="..." src="..."></video>
autoplay, controls, loop and preload are optional attributes.
To get the current elapsed time, use the currentTime property of the tag:
myVideo.elapsedTime
To get the duration of the video, use the duration property:
myVideo.duration