Supersonic
Supersonic

Reputation: 430

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

Upvotes: 0

Views: 3012

Answers (1)

phonicx
phonicx

Reputation: 479

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

Upvotes: 1

Related Questions