Posts

Showing posts with the label exoplayer

Play encrypted video in exo player android?

Play encrypted video in exo player android? I want a play encrypted video which is on my server . i want to play it on exo player . in a sample provided by google on https://github.com/google/ExoPlayer is play only you tube videos. i had tried using change the uri in https://github.com/google/ExoPlayer/blob/master/demo/src/main/java/com/google/android/exoplayer/demo/Samples.java file . but it is not worked may be beacuse my video is encrypted . So how can i play my encrypted video. found any thing usefull? – Nasrudeen Jan 27 '16 at 6:47 1 Answer 1 It's an old question but I hope this answer will help. encrypted video There are a number of ways a video/media file can be encrypted. It can be a simple AES 128 encryption or a more standard DRM protec...

Android Exo Player Play .m3u8 from Android Resources

Android Exo Player Play .m3u8 from Android Resources I am unable to play .m3u8 file from a web server like http://example.com/file.m3u8 I have added the play list file in android resource but it is not playing. How to play the same file from local resources. Thanks, Could you post your code? – Dima Kozhevin Jun 29 at 11:12 1 Answer 1 From ExoPlayer Demo: public void init(Context context, PlayerView playerView) { // Create a default track selector. BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter(); TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter); TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory); // Create a player instance. ...

Exoplayer HLS doesn't show subtitle

Exoplayer HLS doesn't show subtitle I am developing a streaming app. I used for this purpose exoplayer2. I am using HLS streaming protocol. I need to show subtitle when streaming my videos. Everything goes well except subtitle. My player doesn't show the sample subtitle. My code is as following: uri = Uri.parse(url); videoSource = new HlsMediaSource.Factory(DATA_SOURCE_FACTORY).createMediaSource(uri); Uri uri1 = Uri.parse("https://bitdash-a.akamaihd.net/content/sintel/hls/subtitles_en.vtt"); Format subtitleFormat = Format.createTextSampleFormat( null, // An identifier for the track. May be null. MimeTypes.APPLICATION_SUBRIP, // The mime type. Must be set correctly. Format.NO_VALUE, // Selection flags for the track. "en"); DefaultBandwidthMeter bandwidthMeter2 = new DefaultBandwidthMeter(); DefaultDataSourceFactory dataSourceFactory = new DefaultDataSourceFactory(this, U...