有一个全屏的网页,网页里面只有一个media player播放器,全屏方式播放相关视频。
也就是网页播放器,以全屏方式播放视频了。现在要实现,鼠标在视频上(也只能在视频控件上点击,因为视频控件是全屏的,覆盖了整个页面了)一任意点击,网页立即转向另一个页面,就是“location.href='';”请问网页播放器代码怎么写?
这样写可以吗:<EMBED src=http://www.*.com/mediadate/lxlhbcn.asf style="HEIGHT: 45px; WIDTH: 190px" type=audio/mpeg AUTOSTART="1" loop="0"      onclick="location.href='';"    ></EMBED>谢谢
参考资料《
□捕捉键盘和鼠标事件
    EnableContextMenu 与 ClickToPlay 属性为用户提供了在图像窗口进行操作的方法。
如果 EnableContextMenu 属性为 true ,在图像窗口右击鼠标可以打开关联菜单,如果将ClickToPlay 属性设为 true ,用户可以单击图像窗口进行播放与暂停的切换。
    要接收鼠标移动和单击事件,请将 SendMouseMoveEvents 和 SendMouseClickEvents 属性设为 true 。鼠标事件有:
    MouseDown,当用户按下鼠标时产生;
    MouseUp,当用户释放鼠标时产生;
    MouseMove,当用户移动鼠标时产生;
    Click,当用户在媒体播放器上单击鼠标按钮时产生;
    DbClick,当用户在媒体播放器上双击鼠标按钮时产生;
    要接收键盘事件,请将 SendKeyboardEvents 属性设为 true 。键盘事件有:
    KeyDown,当用户按下一个键时产生;
    KeyUp,当用户释放一个键时产生;
    KeyPress,当用户按下并释放一个键时产生;》

解决方案 »

  1.   

    不能这么写,默认的Windows Media Player这种情况下是不处理鼠标单击事件的,除非你自己开发的视频播放控件,而且,JavaScript也不起作用,因为你点击的是控件,而不是页面。
    结论是,你所说的条件无法实现你要的功能。不过MSDN中有这样的内容:Embedding URLs in Digital Media Files
    You can embed URLs in your digital media files by using Microsoft Windows Media Advanced Script Indexer. The Advanced Script Indexer is a tool that enables you to insert and edit scripts within any Windows Media file. You can insert any number of URLs in a file, but only one URL can exist at a specified position in the digital media file. When an embedded URL is encountered in a digital media file, Windows Media Player automatically launches the default Web browser and displays the Web page specified. This feature is called a URL flip. URL flips enable you to synchronize Web pages with specific points in your digital media files.你可以自己去看看,看起来只支持Windows Media file,而不是任意的媒体文件。