Skip to content

ecoad/jwPlayerResponsiveEmbed

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

jwPlayerResponsiveEmbed

JS embed code for JW Video Player

This library allows for jQuery to be loaded after having initialised the Video.

The player will resize based on the parent container and maintain a given configurable aspect ratio, such as 16:9.

<div class="video-container"></div>
<script type='text/javascript' src='jwplayer.js'></script>
<script type='text/javascript' src='jw-player-responsive-embed.js'></script>
<script type='text/javascript'>
if (typeof jwVideoId === 'undefined') { var jwVideoId = 1; }

var sourceConfig = {
    sources: [
        { file: 'http://content.bitsontherun.com/videos/zzz-zzz.mp4' },
        { file: 'http://content.bitsontherun.com/videos/zzz-zzz.webm' }
    ],
    image: 'video-still.jpg',
    aspectRatio: { width: 16, height: 9 }
};

jwPlayerAdvancedEmbed({
    videoId: jwVideoId++,
    sources: sourceConfig.sources,
    image: sourceConfig.image,
    jwPlayerKey: 'YOUR PREMIUM KEY',
    autostart: false,
    skinUrl: 'skin.xml',
    parentContainerCssSelector: '#container',
    videoAspectRatio: sourceConfig.aspectRatio
});
</script>

About

JS embed code for JW Video Player

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published