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

2 JW Player code. one works while the other doesnt. please help

Hi there

I have made another page with a different playlist inserted from the example used here

my page is here

the code that works fine is here

<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="hptitle">Video 1: with a playlist button</h1>
<script src="//"></script>
<script type="text/javaScript">
function initInPlayer(playlistId) {
displaytitle: true,
logo: false,
playlist: '' + playlistId
// By default, the parameter visualplaylist is true.

// End Playlist Overlay Example

function initOutPlayer(playlistId) {
var playerInstance = jwplayer('out-player-demo')
displaytitle: false,
logo: false,
autostart: false,
playlist: '' + playlistId,
width: '100%',
aspectratio: '16:9',
visualplaylist: false


function initPlaylist(player) {
$.ajax(player.getPlaylist()).then(function(data) {
var playlistWrapper = $('.playlist-wrapper');
var playlistTemplate = Handlebars.compile($('#out-player-playlist-template').html());

playlistWrapper.on('click', '.playlist-item-link', setVideo.bind(this, data.playlist, player));
player.on('playlistItem', setActive);

function setVideo(playlist, player, e) {
var currentVideo = $('a').data('mediaid');
var videoIndex = playlist.findIndex(function(video) {
return currentVideo === video.mediaid;



And the code that is not working at all is here

<div class="container">
<div class="row">
<div class="col-lg-12">
<h1 class="hptitle">Video playlist</h1>
<script src="//"></script>
<script type="text/javascript">
file: "//",
image: "//",
title: "Another Title"
function playTrailer(video, thumb) {
file: video,
image: thumb

<div align="center" style="margin:0 0 0 50px">
<a href="javascript:playTrailer('//', '//')"><img alt="" border="0" src="/customer/portal/attachments/256826" /></a>
<a href="javascript:playTrailer('//','//')"><img alt="" border="0" src="/customer/portal/attachments/256827" /></a>
<a href="javascript:playTrailer('//','//')"><img alt="" border="0" src="/customer/portal/attachments/256828" /></a>
<a href="javascript:playTrailer('//','//')"><img alt="" border="0" src="/customer/portal/attachments/256829" /></a>

Some help in this matter would be great


1 Community Answers


JW Player Support Agent  
0 rated :

I copied and pasted your code that is not working onto our QA server. Here is what I had to do to get it working:

1) Your single-line embed at <script src="//"></script> is creating a <div> and calling setup() in its own, so I am embedding just the player library instead:

<script src="//"></script>

2) Your jwplayer(“container”).setup() call is pointing to <div id="container"></div> but I did not see that in your code example, so I added it before your <script type="text/javascript">jwplayer(“container”).setup({

3) Your <a href>s were not appearing on the page at all for me in Chrome, so I changed your style="" to style=“margin:0px 0px 0px 50px” and then they appeared.

Now the code is working for me. And one last thing, you have a Premium license of our player, so you can always use the Submit A Case button in the dashboard to reach us via e-mail. That way you do not have to use the forums and we can e-mail links to test pages, etc.

This question has received the maximum number of answers.