简体   繁体   中英

Open jwplayer as a separate pop up

I just downloaded jwplayer and I must say I am lost. Probably a piece of cake for you guys.

Here is what I have used in my html file:

<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.

Thanks in advance

You'll need to use javascript to open a new window that displays a separate file with your player inside.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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