开发者

How do you make a .mov "click to watch" so that it is not downloaded immediately?

On my w开发者_C百科ebsite, I have an embedded video (.mov) which opens and begins to play immediately when the user opens the page. I would like to make the site easier to use by making an image of the first frame which users can click on to begin the video. What's the best way to do this in HTML/javascript?


<embed src="http://www.tizag.com/files/html/htmlexample.mpeg"
 autostart="false" />

check autostart is false


The way I did this was to make a javascript function which updated the innerHTML line when clicked, like this:

function displayVideo() {
  document.getElementById('videoContainer').innerHTML = '<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" width="320" height="480" style="float:left"><param name=src value="resources/screencast.mov" /><param name=controller value=false /><param name=autoplay value=true /><param name=loop value=true /><embed src="resources/screencast.mov" width="320" height="480" controller=false autoplay=true loop=true pluginspage="http://www.apple.com/quicktime/download/" type="video/quicktime" /></object>';

}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜