javascriptjqueryhtmlarraysjwplayer7

jwplayer is not loading when using external js file


I used jw player ads edition and seems my code not work.i used external js configuration file..Not sure what the really issue..looking for support . Thanks!.

my code:

in external js file: i put following code: HTML source:

jwplayer("my-video").setup({
  file: file,

  aspectratio: "16:9",
  skin: {
    name: "five",
    active: "red",
    inactive: "white",
    background: "black"
  },
  width: width,
  height: height,
  primary: primary,
  advertising: advertising
});

in pre.html

I put following code:

<script type="text/javascript">

var file: "https://s3.amazonaws.com/aws-website-awsvideouploadvastadscustomizer-f3qi3/videos/JACKALS+Trailer+(2017)+Horror+Movie.mp4",
var width: "580",
var height: "360",
var primary: "flash",
var advertising: { 
  var client: "vast",
  var schedule: {"ad tag"}
};
</script>

Solution

  • First of all you need to set the JW-Script URL (https://support.jwplayer.com/customer/portal/questions/16758746-cdn-url). In the dashboard you can set the height and width of the player and color things.

    Then you need to set-up the JW Player (say that the div #my-video is the player and then you need to set-up the file)

    var playerInstance = jwplayer("my-video");
    
    playerInstance.setup({
        'file' : 'https://s3.amazonaws.com/aws-website-awsvideouploadvastadscustomizer-f3qi3/videos/JACKALS+Trailer+(2017)+Horror+Movie.mp4',
    });