如何在网站上将视频显示为图标?
问题描述:
是否可以通过将视频或缩略图的图标排列在网站页面上来显示视频,所以每当我单击一个视频时,都应该打开一个新窗口来播放该视频?不能在同一页面上播放.
作为此代码,但target ="_ blank"不会将我引向另一页?
Is there a way to display the video in a website page as an arranges icons of videos or thumbnails, so whenever I click on one video it should open a new window to play that video? not play it in the same page.
as this code, but the target="_blank" not leading me to another page?
<a href="video1.aspx" target="_blank">
<object type="video/x-ms-wmv" data="Videos/clock.avi" width="320" height="255" >
<param name="src" value="Videos/clock.avi">
<param name="autoStart" value="0">
alt : <a href="Videos/clock.avi">clock.avi</a>
</object>
</a>
答
您为什么认为点击该元素应该在其他页面显示视频?这不是它的工作方式.基本上,您应该在单击时调用JavaScript,创建具有类似内容(但大小可能不同),并带有<object>
的窗口,并显示它:
http://www.blooberry.com/indexdot/html/topics/windowopen.htm [ ^ ],
http://www.w3schools.com/jsref/obj_window.asp [ http://www.w3schools.com/jsref/dom_obj_document.asp [ http://www.javascripter.net/faq/writingt.htm [
Why do you think a click to that element should show video in different page? This is not how it works. Basically, you should call a JavaScript on click, create a windows with the similar content (but perhaps a different size), with<object>
, and show it:
http://www.blooberry.com/indexdot/html/topics/windowopen.htm[^],
http://www.w3schools.com/jsref/obj_window.asp[^].
You will need to use thewindow
propertydocument
to write your content to it:
http://www.w3schools.com/jsref/dom_obj_document.asp[^].
Like in this sample:
http://www.javascripter.net/faq/writingt.htm[^].—SA
您可以通过对视频文件进行采样来制作GIF动画,并使用IMG标签播放视频
唯一的问题是GIF的调色板性质会在缩略图中创建一些颜色问题
you could make an animated GIF by sampling the video file, and use that an IMG tag into playing the video
The only issue there is the palette nature of GIFs creates some colour issues in the thumbnail