
Embed All videos on one external js file
Hi sir good day,
I was trying to figure out if its possbile to embed like all of the videos on one external file? So I can use it over and over again?
for example right now I have this config file for our player..
***********************
jwplayer.config.js
jwplayer.key="VojTxqz9jLz+lqwTCgks/kyn2EJHJSSy56RhOQ==";
var jwConfig = {
width: "100%",
aspectratio: '16:9',
}
***********************
*********
embed script on the page
<script>
jwConfig.image = 'images/covers-big/video-covers/movie-1234.jpg';
jwConfig.file = 'tour-videos/tour-videos/movie-1234-h264-480p.mp4';
var playerInstance = jwplayer('movie-1234');
playerInstance.setup(jwConfig);
</script>
**************
that is how we embed the video on each of the pages we have...
But what would I like to this is like.. on the external js file..
I want to list all of the video we have.. and then just use them when we need them..
for example..
***************
<div id="video1"></div>
<div id="video2"></div>
var playerInstance = jwplayer('video1');
var playerInstance = jwplayer('video2');
playerInstance.setup(jwConfig);
***************
and on the config file.. there will be the path for the two different videos..
***************
var jwConfig = {
width: "100%",
aspectratio: '16:9',
file and image for video1,
image = 'images/covers-big/video-covers/video1.jpg';
file = 'tour-videos/tour-videos/video1-h264-480p.mp4';
file and image for video2,
image = 'images/covers-big/video-covers/video2.jpg';
file = 'tour-videos/tour-videos/video2-h264-480p.mp4';
file and image for video3,
image = 'images/covers-big/video-covers/video3.jpg';
file = 'tour-videos/tour-videos/video3-h264-480p.mp4';
***************
Is this possible sirs?? I badly need it.. or is there anyway to use all of the videos without manually embedding them?
If only I can use one file that lists all of the sources.. and then target the IDs only on the html page