I am trying to understand the new ExoPlayer library introduced this year in Google I / O 2014 so that I can include it in my application.
I try to transfer mp3 via HTTP, but have not been successful so far. I am not sure if this is possible, but I am trying to accomplish this without extending any of the Source / Sample base classes. My code is as follows:
In my work
SampleSource s = new FrameworkSampleSource(this, Uri.parse("http://traffic.libsyn.com/joeroganexp/p518.mp3"), null, 1); // Since I only have 1 audio renderer ExoPlayer player = ExoPlayer.Factory.newInstance(1); MediaCodecAudioTrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(s); player.prepare(audioRenderer); player.setPlayWhenReady(true);
Logcat
3363-3376/com.kevintcoughlin.smodr V/FFmpegExtractor﹕ SniffFFMPEG 07-06 15:52:34.080 3363-3376/com.kevintcoughlin.smodr I/FFmpegExtractor﹕ android-source:0xb7c53e00 07-06 15:52:34.084 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android source begin open 07-06 15:52:34.084 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android open, url: android-source:0xb7c53e00 07-06 15:52:34.084 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ ffmpeg open android data source success, source ptr: 0xb7c53e00 07-06 15:52:34.088 3363-3376/com.kevintcoughlin.smodr D/FFMPEG﹕ android source open success 07-06 15:52:34.108 3363-3363/com.kevintcoughlin.smodr W/EGL_genymotion﹕ eglSurfaceAttrib not implemented 07-06 15:52:34.116 3363-3363/com.kevintcoughlin.smodr E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from GradienCache 07-06 15:52:34.120 3363-3363/com.kevintcoughlin.smodr E/OpenGLRenderer﹕ MAX_TEXTURE_SIZE: 16384 07-06 15:52:34.128 3363-3363/com.kevintcoughlin.smodr E/OpenGLRenderer﹕ Getting MAX_TEXTURE_SIZE from Caches::initConstraints() 07-06 15:52:34.128 3363-3363/com.kevintcoughlin.smodr E/OpenGLRenderer﹕ MAX_TEXTURE_SIZE: 16384 07-06 15:52:34.128 3363-3363/com.kevintcoughlin.smodr D/OpenGLRenderer﹕ Enabling debug mode 0 07-06 15:52:34.640 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ [mp3 @ 0xb7c57040] Estimating duration from bitrate, this may be inaccurate 07-06 15:52:34.640 3363-3376/com.kevintcoughlin.smodr I/FFMPEG﹕ Input
For my unprepared eye, it seems that I can get TrackInfo correctly, but I have a problem reading the data over HTTP. It also seems that, as the framework sniffs mimetype, it fails even if I get the type "audio / mpeg".
Again, I appreciate any direction I receive. I understand that these APIs are very new.
Thanks!
android ffmpeg android-mediaplayer
kevintcoughlin
source share