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

Embedding player widthout script in head


Dear JWPlayer team,

I'm from Cleeng, and we are working on simple integration of your player to out system.

My question is:

Am I able to embed the player without putting this line:

<script src="http://jwpsrv.com/library/Qu3ehgwAEeSf2CIAC0MJiQ.js"></script>

into header of my website?

It is possible to embed your player in blog? Without additional plugins, just by pasting the embed code to the post?


Let me know if anything is not clear, I will do my best to align.

Thanks,
Tomek

6 Community Answers

MisterNeutron

User  
0 rated :

You have to load the JW Player script. How would it work, otherwise? You don't have to load it from the jwpsrv.com site, however. You can just download the three files, host them yourself, and load them from your own server.

You need jwplayer.js, jwplayer.html5.js, and jwplayer.flash.swf, and they should be sitting together in a directory. You then just load jwplayer.js in the <head> section - that script will call the others if it needs them.

Cooper Reid

JW Player Support Agent  
1 rated :

It doesn’t necessarily have to be in the <head>, if that’s what you’re asking. The jwplayer source must come before your setup call, however. Yes, jwplayer can be embedded in a blog – blog is a very broad term. What is the particular blogging platform you are using? If it’s Wordpress, I recommend using our Wordpress plugin.
-Cooper

tszad

User  
0 rated :

Thanks Cooper for your answer!

Cleeng allows jwplayer customers to monetize their video. Our solution is simple, you have to put the player embed code to our form and this embed code is hidden behind the paywall.

Form, I mean one text area, most of the players are fine with that, as usually there is no additional script which has to be put in the header of the www.

I was talking about the blog, becuase it is kind of similar, but now we can forget about it :)

This is what I put in:

<script src="http://jwpsrv.com/library/Qu3ehgwAEeSf2CIAC0MJiQ.js"></script>
<div id='playerHCh5MFLT'></div>
<script type='text/javascript'>
jwplayer('playerHCh5MFLT').setup({
playlist: '//content.jwplatform.com/feed/HCh5MFLT.rss',
width: '100%',
aspectratio: '16:9',
autostart: 'true'
});
</script>

Which is script + actual embed code.

This is the vod created using Cleeng with this code:
http://jwplayerdemo.cleeng.com/vod/test/A123334370_NL

js console shows:
ReferenceError: jwplayer is not defined

Which problably means that we are trying to load the player before the script is fully loaded (but I am not sure about it)

You can get access to edit this video, just log in on Cleeng as:
@: jwplayerdemo@cleeng.com
P: jwplayer
to edit video and embed code (you have to be logged in): https://cleeng.com/dashboard/vod/add/430069001

Let me know if you need more info.

Thanks
Tomek

Cooper Reid

JW Player Support Agent  
0 rated :

Tomek,

I can’t find the code on your page that is setting up the player. I see what you posted above, and I tested that on a standalone page and it works perfectly. Are you positive that the jwplayer source is fully-loaded before you try calling jwplayer(‘playerHCh5MFLT’).setup ?

Kind Regards,
Cooper
Client Support Engineer, JWPlayer

tszad

User  
0 rated :

Dear Cooper,

To reproduce this problem, please, follow those steps:

1. go to http://cleeng.com/us/my-account
2. log in:
@: jwplayerdemo@cleeng.com
P: jwplayer

3. Click on video on demand (left panel)
4. You can see only one video created by me, clicking on it you will the hosted page with protected video.
5. On hosted page click on preview access (top black bar)
6. Now is the moment when video should be visible. You can notice the js console error at the moment.
7. To make sure that embed code is in place, please click on "edit video" and go to step 3 ("add you video")


Are you positive that the jwplayer source is fully-loaded before you try calling jwplayer(‘playerHCh5MFLT’).setup ?

- No, I am not positive. Are you able to validate it?



Please, check if you can help.


Thanks,
Tomek

Cooper Reid

JW Player Support Agent  
0 rated :

Tomek,

That error you are seeing simply means the JWPlayer library hasn’t loaded you. You need to make sure your jwplayer.js file is included before you make the setup call.

-Cooper

This question has received the maximum number of answers.