Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Embedded video player and token signing


Hello, I have created a small HTML page and want to use an embedded player to play a movie that is secured via token signing. I keep getting a "no playable sources found" error. Am I forgetting something or doing something wrong? My html looks as below and I have my security set up as "Secure video downloads and player embeds":

<!DOCTYPE html>
<html>
<head>
<script src="http://jwpsrv.com/library/<myaccounttoken>.js"></script>
</head>
<body>

<h1>Hello</h1>


<div id="myElement">Loading the player...</div>
<script type="text/javascript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
file: "http://content.jwplatform.com/previews/K9N7xZg8-LrMPw2Ku?exp=1435047932&sig=86e6596928fe3ebd5a46a5ffc7d95725",
width: 640,
height: 360
});
</script>

</body>
</html>

6 Community Answers

jherrieven

User  
0 rated :

Try adding:

"type":"mp4"

(assuming its an MP4 you are trying to play)

James Herrieven

jherrieven

User  
0 rated :

Actually, scratch that...

The URL you are using is to the "preview" view that JW provide - which is just an HTML page including the setup details.

You need to either just include a link to the full embed library, with no additional setup code needed - it's included in the JS file:

<script type="text/javascript" src="http://content.jwplatform.com/players/K9N7xZg8-LrMPw2Ku.js?exp=1435048520&amp;sig=3dfce2c2e92bf646ddba1262b56823ef"></script>

Or, if you want to specifically control the setup parameters within your page, link to the playlist file directly:

http://content.jwplatform.com/jw6/K9N7xZg8.xml?exp=1435058909&sig=6f7987af792d81ab9b34071c8176b46e

In this case you setup code would be:

<script type="text/javascript">
var playerInstance = jwplayer("myElement");
playerInstance.setup({
playlist: "http://content.jwplatform.com/jw6/K9N7xZg8.xml?exp=1435058909&sig=6f7987af792d81ab9b34071c8176b46e",
width: 640,
height: 360
});
</script>

s...

User  
0 rated :

That did the trick, thanks James!

s...

User  
0 rated :

On second thought, I'm afraid it still doesn't work. I have this preview which works fine:
http://content.jwplatform.com/previews/K9N7xZg8-x7vog7xb?exp=1435056148&sig=30ea0ce08687d6f6fdaa6a96688134ae

However when I right mouse click on that preview page and copy this part to a html file on my local harddrive:
<div id="botr_K9N7xZg8_x7vog7xb_div"></div>
<script type="text/javascript" src="http://content.jwplatform.com/players/K9N7xZg8-x7vog7xb.js?exp=1435053154&amp;sig=5a2d5d263361b1f94bb8758e34d5ac15"></script>

I get a "Could not load player configuration"?

jherrieven

User  
0 rated :

There are a couple of points to consider here:

1) This won't work directly from a file on a hard-disk. It needs to at least be run via a localhost web server.

2) The "exp" timestamp and "sig" signature are dynamically generated so would need to be included using a mechanism to ensure they are fresh - not sure how JW suggest doing this (as I don't use platform), but I would think they must provide a means....

James

jherrieven

User  
0 rated :

Update to point (2) - you should generate the "exp" and "sig" codes yourself when you render the setup code. This provides more detail:

http://support.jwplayer.com/customer/portal/articles/1433647-token-signing-with-jw-platform

James

This question has received the maximum number of answers.