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.
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.
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
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