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

Using multiple keys with different jwplayer instances


Hello,

We are trying to create a Video Ad Format using JWPlayer. Something like this:
http://demos.netsonic.tv/demos_web/vid_interstitial_demo.php
(Not using JWPlayer in that demo.)

But we wondered..
What if the Publisher site already has JWPlayer using its own configuration?

We would like to have both, but we don't want to modify any behaviour on the publisher site or video.
When we call to the jwplayer.js with our version, it won't load because an instance called "jwplayer" already exists in this page.
We also don't want to mix our keys with the publisher's one.

I also tried something like this:

<script type="text/javascript">
// Publisher player back up
var oldjwplayer = jwplayer;
jwplayer = undefined;
</script>

<script type="text/javascript" src="loading our jwplayer.js"></script>

<script type="text/javascript">
jwplayer.key = "...";
var our_jwinstance = jwplayer("div_id");
our_jwinstance.setup(config);

// Keeping our player and restoring publishers's
var newjwplayer = jwplayer;
jwplayer = oldjwplayer;
</script>

But it looks like it's not working as I keep getting a "Could not load player configuration" error.

I've been looking for a topic like this, but I only found about multiple players using the same key and jwplayer instances.

Is there any solution to work like this using JWPlayer?

Best regards,
Juan

7 Community Answers

George

JW Player Support Agent  
1 rated :

Hello Juan,

The best solution would be to be embedding your Ads player within an iFrame. I have a sample test page here:
http://qa.jwplayer.com/~george/Ranked_Engage.html

Make sure your crossdomain.xml is configured correctly. My test page wasn’t working for a bit then when I went to Chrome’s console it woke up. So this is for demo purposes only.

Hope it works for you.

jgomez

User  
0 rated :

Hello George,

Yes, it might be a solution.

After some tests I did that:
http://pro.netsonic.tv/previews/newjw/ne/

But I found 2 things:
- In IE8 (don't know about other) I'm getting an:
Object doesn't support this property or method: Line 7 Character 7616.
Maybe JWPlayer 7 is not compatible with IE8?

- In Chrome and IE the player goes black after a seconds, don't know exactly why.

Thanks!

Best,
Juan

George

JW Player Support Agent  
0 rated :

Hello Juan,

The way you are setting up the player may be the issue. Using DOM methods like document.write() for example interrupt the player setup. I’d stick to the standard setup solution as illustrated in the test page.

Due to JW7’s new skinning model, IE8 is not officially supported with JW7.
http://support.jwplayer.com/customer/portal/articles/1403726-jw-player-7-release-notes

Let me know if you need anything else.

Sincerely,
George
JW Player
Support Engineer

jgomez N/A

User  
0 rated :

Hello George,

The problem is that due to technical limitations we can't use it this way.
Each Publisher have its own configuration and we need the JS to create the Iframe, so it won't have crossdomain problems.

For example, the iframe has to be created in the element the publisher told us (using an id).

Anyway, I'm not doing any synchronous function like document.write or anything extrange..
You see here:
http://pro.netsonic.tv/previews/newjw/ne/js.js

Best,
Juan

George

JW Player Support Agent  
0 rated :

Hello Juan,

Then something like this should work, no?
http://qa.jwplayer.com/~george/iframe_dom.html

jgomez N/A

User  
0 rated :

Hello George,

We would like to just use a static JS though a CDN, like we're doing now.

What I was trying to do is just create dinamically all the player content, including iframe in this case, so we don't have to call anything else.

If we store an html with the player in our servers, we'll have to face the iframe cross-domain policy problem between or Publishers site and our server.
As far as I know, the code inside the Iframe couldn't get out, and the code outside coudn't get in.
So for example we couldn't make an animation of the iframe "appearing" on the main document page when we know for sure the Ad is correctly loaded (inside iframe event).

Best,
Oscar

George

JW Player Support Agent  
0 rated :

Hello Oscar,

The only way I know, that separates the two codebases for a good reason is the iFrame. As an alternative you could use the existing player library on their page and call your key in order to instantiate your ads player. But you would have to check if they have jwplayer, then check the version and then call the appropriate key.

My knowledge is starting to stretch thin at this point.

This question has received the maximum number of answers.