Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Caption - Subtitle not showing ?


Hi,
I start develop jwplayer using android sdk . my issue video works perfect but when adding caption in my video not showing subtitle in video hears my code :

JWPlayerView playerView = (JWPlayerView) findViewById(R.id.playerView);
PlaylistItem video = new PlaylistItem("http://dl3.aflamy.ps:1935/TEST/_definst_/mp4:hisham/The.Founder.2017/The.Founder.2016.mp4/playlist.m3u8");
Caption captionEn = new Caption();
captionEn.setFile("http://dl1.aflamy.ps:1935/hisham/The.Founder.2017/The.Founder.2016.English.srt");
captionEn.setLabel("English");

Caption captionAr = new Caption();
captionAr.setFile("http://dl1.aflamy.ps:1935/hisham/The.Founder.2017/The.Founder.2016.srt");
captionAr.setLabel("Arabic");

List<Caption> captionTracks = new ArrayList<>();
captionTracks.add(captionAr);
captionTracks.add(captionEn);
video.setCaptions(captionTracks);
playerView.load(video);

some one can help me about this ?

1 Community Answers

George

JW Player Support Agent  
0 rated :

Hi,

I believe you’re missing CORS headers on your resource.

Here’s the same caption file hosted on my server:
http://bob.jwplayer.com.s3.amazonaws.com/the_founder.srt

Works as expected. I’d also go for a filename that does not contain ‘.’ characters

This question has received the maximum number of answers.