简体   繁体   English

打开jwplayer作为单独的弹出窗口

[英]Open jwplayer as a separate pop up

I just downloaded jwplayer and I must say I am lost. 我刚刚下载了jwplayer,我必须说我迷路了。 Probably a piece of cake for you guys. 可能对你们来说是小菜一碟。

Here is what I have used in my html file: 这是我在html文件中使用的内容:

<div id="myElement">Loading the player...</div>

<script type="text/javascript">
    jwplayer("myElement").setup({
        file: "/1.mp4",
    });
</script>

It totally works fine with this, it opens as a small player in my webpage and plays the video. 完全可以正常使用,可以在我的网页中以小播放器的形式打开并播放视频。

But I want it as a link or an anchor tag where in I have something like "HELP" as the anchor and when you click on that it should open a separate window and display the video. 但我希望将其作为链接或锚标记,在其中使用诸如“ HELP”之类的锚作为锚点,当您单击它时,它应该打开一个单独的窗口并显示视频。

Thanks in advance 提前致谢

You'll need to use javascript to open a new window that displays a separate file with your player inside. 您需要使用javascript打开一个新窗口,该窗口显示播放器位于其中的单独文件。

Create a new page on your server with the video inside and check that it is working, then on your original page write some script that will open the new window when the link is clicked. 在包含视频的服务器上创建一个新页面,并检查视频是否正常运行,然后在原始页面上编写一些脚本,单击链接后将打开新窗口。

Something like: 就像是:

document.getElementById("MY_LINK_ID").onclick = function () {

    window.open("http://www.MY_WEBSITE.com/MY_VIDEO_PLAYER_PAGE", "NAME_OF_MY_WINDOW");

};

See here for more information: http://www.w3schools.com/jsref/met_win_open.asp 请参阅此处以获取更多信息: http : //www.w3schools.com/jsref/met_win_open.asp

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM