Using the JWPlayer plugin hosted on * my * server

I am trying to use the JWPlayer Caption plugin in an environment that does not extend to the public Internet.

All the documentation I read about JWPlayer plugins ( like this ) just says to insert a JSON snippet like this in your JWPlayer setup code:

plugins: { "captions-2": { file: "/assets/captions.srt" } 

But when I do this, JWPlayer tries to download the script plugin from the following URL http://lp.longtailvideo.com/5/captions/captions-2.js , but - because my system cannot get to the public Internet - this URL is not available .

I would like to host the captions-2.js myself, but I don't know how to link to the file in my JWPlayer setting. Can someone tell me how to configure the location of the plugin file that is trying to load JWPlayer?

Thanks.

+4
source share
2 answers

It turns out that you can refer to the plugin either through its "name", in which case the plugin will be downloaded from the JWplayer content servers or at the URL, in which case JWPlayer will try to download everything that is specified at the specified URL and use its like a plugin. So, for the example above, if I downloaded the captions-2.swf and saved it on a local server, I could link to it like this ...

 plugins: { "/static/js/jwplayer-5.8/captions-2.swf": { file: "/assets/captions.srt" } } 
+2
source

I did the same: I posted .swf and captions-2.js (plugin) on my local server, which is configured using Eclipse.

My sample code is:

 <script type="text/javascript"> jwplayer("mediaplayer").setup({ flashplayer: "player.swf", file: "video.mp4", plugins: { 'http://localhost:8080/myvideo/captions-2.js': { file: "/assets/captions.srt" } } }); </script> 

In addition, I used HTTPFOX to verify the content returned from the request.

Everything worked fine, but the closed signature did not work. I think captions.file not installed.

+1
source

Source: https://habr.com/ru/post/1391749/


All Articles