exoplayer

How to use android exoplayer

旧时模样 提交于 2019-12-20 09:13:20
问题 I am looking to implement Google's ExoPlayer in my app. Their documentation seems pretty vague to me, and all I am looking for is to play a video from an URL, no complicated custom settings or anything like that. Haven't found any tutorials on how to do it. The example they have on git is way too complicated for what I need and, since I am new to video streaming, I did not understand much. All I have managed to do so far is to display a com.google.android.exoplayer.AspectRatioFrameLayout .

ExoPlayer stops playing in background

青春壹個敷衍的年華 提交于 2019-12-19 03:25:33
问题 I have an application that keeps a global instance of an ExoPlayer instance to facilitate audio streams in the background. After opening lots of apps, the audio stops playing. It happens as follows: open Activity that starts playing audio press back button to close Activity the audio is still playing and keeps doing so if you leave the device alone (as intended) However, when you open a dozen or more apps after the last step, the ExoPlayer stops playing at some point. My guess is that a

ExoPlayer stops playing in background

杀马特。学长 韩版系。学妹 提交于 2019-12-19 03:25:00
问题 I have an application that keeps a global instance of an ExoPlayer instance to facilitate audio streams in the background. After opening lots of apps, the audio stops playing. It happens as follows: open Activity that starts playing audio press back button to close Activity the audio is still playing and keeps doing so if you leave the device alone (as intended) However, when you open a dozen or more apps after the last step, the ExoPlayer stops playing at some point. My guess is that a

Android ExoPlayer - downloading video (non DASH / HLS) and streaming at the same time

孤者浪人 提交于 2019-12-18 15:02:23
问题 I would like to download a video that is streaming in ExoPlayer. As an aside and even before using ExoPlayer I downloaded a file from an input stream provided by HttpURLConnection and played the file from local storage. This is ok, however it does not solve my problem of simultaneous streaming and caching. ExoPlayer also provides a caching system and these seem to work only for DASH or HLS stream types. I am using none of these and want to cache mp4 with the ExtractorRendererBuilder . (This

Android ExoPlayer - downloading video (non DASH / HLS) and streaming at the same time

 ̄綄美尐妖づ 提交于 2019-12-18 15:02:21
问题 I would like to download a video that is streaming in ExoPlayer. As an aside and even before using ExoPlayer I downloaded a file from an input stream provided by HttpURLConnection and played the file from local storage. This is ok, however it does not solve my problem of simultaneous streaming and caching. ExoPlayer also provides a caching system and these seem to work only for DASH or HLS stream types. I am using none of these and want to cache mp4 with the ExtractorRendererBuilder . (This

How to add Subtitles(.SRT files) to video in Exoplayer android?

萝らか妹 提交于 2019-12-18 12:32:32
问题 i am working on a project where i should play .srt files along with video in android. I was working through the samples of Exoplayer but cant able to play .srt files with video. The code i used is, MediaSource mediaSource = new HlsMediaSource(Uri.parse("https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"), mediaDataSourceFactory, mainHandler, null); Format textFormat = Format.createTextSampleFormat(null, MimeTypes.APPLICATION_SUBRIP, null, Format.NO_VALUE, Format.NO_VALUE, "en",

Google ExoPlayer guide

醉酒当歌 提交于 2019-12-18 12:03:15
问题 I am struggling to build basic app with ExoPlayer. 回答1: First you need to add this in your build.gradle compile 'com.google.android.exoplayer:exoplayer:r2.1.1' 1. Your Layout File <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <com.google.android.exoplayer2.ui.SimpleExoPlayerView android:id="@+id/player

How to pause ExoPlayer 2 playback and resume (PlayerControl was removed)

﹥>﹥吖頭↗ 提交于 2019-12-18 11:45:17
问题 In ExoPlayer < 2.x there was a class PlayerControl with pause() and resume() functions but it was removed. I can't find a way to do this on ExoPlayer 2 . How can I pause and resume a playback? 回答1: you can use void setPlayWhenReady(boolean playWhenReady); . If Exo is ready, passing false you will pause the player. Passing true you will resume it. You can check the player's state using getPlaybackState() 回答2: This is my way. Create two methods and call them when needed. private void

ExoPlayer+Shaka-packager播放自制DRM视频

情到浓时终转凉″ 提交于 2019-12-18 09:57:11
1. 工具说明 1.1 ExoPlayer ExoPlayer是google开源的应用级媒体播放器项目,构建在Android的底层多媒体API之上。该开源项目包含ExoPlayer库和演示demo。 github地址: https://github.com/google/ExoPlayer 1.2 shaka-packager Shaka Packager是用于DASH和HLS打包和加密的工具和媒体打包SDK。 它可以准备和打包媒体内容以进行在线流式传输,支持Widevine和其他DRM系统的通用加密。 当前支持的加密系统有: widevine, playready, fairPlay, Marlin github地址: https://github.com/google/shaka-packager 2. 加密视频 2.1 下载shaka-packager 在github上可以下载源码进行自行编译,也可以只下载上面的release版本的工具。 建议下载linux版本的。当前版本是 v2.3.0 2.2 使用ffmpeg生成不同规格的片源 由于在线流会根据不同的网络状况播放不同的分辨率的视频,所以一般都会把一个高清片源转成多种规格的片源以适应不同的网络环境。 在这里可以使用ffmpeg工具来转换。这个工具的使用说明网上有许多说明,在此就不再累述。 当然,此步骤可以省略 。

Custom UI on exoplayer sample

让人想犯罪 __ 提交于 2019-12-18 03:39:13
问题 ** I really need help if you don't know anything don't give me a negative point :| if something bother you comment** I want to write custom UI for my player in Exoplayer(change button of pause play or add new buttons like player speed next and etc) . I use Exoplayer sample from github and before add code to my original project, I want to test the custom UI on official sample. I read pages in Stackoverflow and tuts+ about custom UI but I really confused! why change some buttons image or change