-1

How can we external add video url to Jw player through API using Java.

If possible then please give example also so that i can understand better & it would be very helpful to me.

Thanks.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Question Warriors
  • 117
  • 1
  • 1
  • 12
  • Have you done any initial coding for this? if so please share the java code here to help SO members understand, how much you have progressed.Thanks – Hitesh May 30 '16 at 17:33
  • @hitesh Have you use Jw player ever before..? Actully I don't know where to start & that is the only reason why i asked for a sample. Thanks – Question Warriors May 31 '16 at 06:12

2 Answers2

1

Do you mean Java or Javascript? If you mean Javascript, you have a few options to add an external add video URL to JW Player:

1) If you are using the single-line embed from your JW Player account dashboard, just add your external content URL directly in the Content section of your dashboard. See step #2 at https://support.jwplayer.com/customer/portal/articles/1920164-how-do-i-publish-my-first-video- for more details.

2) If you are writing the embed code directly on your page, add the direct video URL in the file: '' parameter of your jwplayer('div_id').setup() call:

jwplayer('div_id').setup({
    file: 'your_external_video_URL'
});

You can read more about your embedding options with JW Player at http://support.jwplayer.com/customer/portal/articles/1406723-mp4-video-embed

If you meant Java, then you would either need to make your Java code output the Javascript I explained here. If you need Java to allow uploads to our JW Platform API, then you would need to have the proper syntax to hit the /videos/create endpoint of our JW Platform API as documented at https://developer.jwplayer.com/jw-platform/reference/v1/methods/videos/create.html

Todd
  • 249
  • 1
  • 4
1

For java first you need to use BOTR API (Bits On The Run) :

Code :

Map<String, String> map = new HashMap<String,String>();
Map<String, String> sourceType = new HashMap<String,String>();
BotrAPI api = new BotrAPI("API KEY", "API SECRET");
map.put("title", "Yureka..!!");
map.put("sourcetype", "url");
map.put("sourceformat", "youtube");
map.put("sourceurl", "https://www.youtube.com/watch?v=jebJ9itYTJE");
String output = api.makeRequest("videos/create", map); //OXm5HcGA
Question Warriors
  • 117
  • 1
  • 1
  • 12