brianwernick / exomedia Goto Github PK
View Code? Open in Web Editor NEWAn Android ExoPlayer wrapper to simplify Audio and Video implementations
License: Apache License 2.0
An Android ExoPlayer wrapper to simplify Audio and Video implementations
License: Apache License 2.0
I do like tutorial but still cant play .m3u8 url http://edge7.psitv.tv:1935/liveedge/292277227873_600/playlist.m3u8
what wrong with me ?
thanks you
A margin appears on the right side of devices using software Navigation Bar.
It happens when your rotate the device when EMVideoView is fullscreen, changing from being on Landscape + Immersive Mode to Portrait without Immersive Mode nor Fullscreen.
Thank for the library,
I want to set listener so that player will play next audio file after the current one ended.
How can I achieve that?
In Exoplayer, I found sth like this:
@Override
public void onPlayerStateChanged(boolean playWhenReady, int playbackState) {
if(playbackState == ExoPlayer.STATE_ENDED){
}
}
Hi,
From the demo, we can play the audio playlist in the AudioPlayerActivity and AudioService handle all the audio service took place when play music. Thus, currently with the demo if I have more than one playlist then I wont be able to go to now playing playlist.
I have three different playlist possible four, I looked at the google play music in which the now playing bar appear at the bottom of the play list activity. And when user tap or swap it up then the audio player appear.
Which are the possible ways I can create that now playing behavior, in other word, it appears as a now playing bar when user back to playlist and when user tap or swipe it up audio player like the AudioPlayerActivity appear?
What I am thinking is using the fragment by converting the AudioPlayerActivity to AudioPlayerFragment and attach it with the three playlist.
what do you think? Thank
There is currently no way to set the progressCallback variable without calling startProgressPoll(). But the start() method, calls startProgressPoll() for us. We need a way to set the callback before calling start() and without having to call startProgressPoll(). And really, startProgressPoll() should not require any arguments - one method to start polling and sending updated to whichever bus or progressCallback.
Thank you for developing this helpful library around exoplayer.
Apparently the documentation link in the root README.md is pointing to an invalid url:
http://devbrackets.com/dev/libs/docs/exomedia/2.4.0/index.html
The latest working documentation version link is: http://devbrackets.com/dev/libs/docs/exomedia/2.3.4/index.html
The README says that ExoMedia falls back to MediaPlayer on Android 4.0.* and lower but MediaPlayer does not actually support true streaming. I think that should be made more clear.
Here's my layout xml file:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<TextView
android:id="@+id/fieldName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/default_text_size"
/>
<com.devbrackets.android.exomedia.EMVideoView
android:id="@+id/fieldValue"
android:layout_width="match_parent"
android:layout_height="300dp"
android:layout_gravity="center"
android:layout_below="@id/fieldName"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
app:defaultControlsEnabled="true"
/>
</RelativeLayout>
When I'm inflating it dymamically:
view=LayoutInflater.from(parent.getContext()).inflate(R.layout.field_video_layout, parent, false);
using Gradled jar linked through
compile 'com.devbrackets.android:exomedia:2.5.1'
it works perfect, but whenever I embed ExoMedia sources as library to my project, like:
compile project(":exomedia")
where :exomedia is library subproject I have this:
android.view.InflateException: Binary XML file line #44: Error inflating class com.devbrackets.android.exomedia.EMVideoView
at android.view.LayoutInflater.createView(LayoutInflater.java:620)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:758)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at ru.ivanovpv.cellboxkeeper.android.FieldListAdapter.onCreateViewHolder(FieldListAdapter.java:117)
at ru.ivanovpv.cellboxkeeper.android.FieldListAdapter.onCreateViewHolder(FieldListAdapter.java:75)
at android.support.v7.widget.RecyclerView$Adapter.createViewHolder(RecyclerView.java:5228)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4453)
at android.support.v7.widget.RecyclerView$Recycler.getViewForPosition(RecyclerView.java:4363)
at android.support.v7.widget.LinearLayoutManager$LayoutState.next(LinearLayoutManager.java:1961)
at android.support.v7.widget.LinearLayoutManager.layoutChunk(LinearLayoutManager.java:1370)
at android.support.v7.widget.LinearLayoutManager.fill(LinearLayoutManager.java:1333)
at android.support.v7.widget.LinearLayoutManager.onLayoutChildren(LinearLayoutManager.java:562)
at android.support.v7.widget.RecyclerView.dispatchLayout(RecyclerView.java:2900)
at android.support.v7.widget.RecyclerView.onLayout(RecyclerView.java:3071)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1055)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.support.v4.widget.DrawerLayout.onLayout(DrawerLayout.java:1043)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
at android.widget.FrameLayout.onLayout(FrameLayout.java:388)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1671)
at android.widget.LinearLayout.layoutVertical(LinearLayout.java:1525)
at android.widget.LinearLayout.onLayout(LinearLayout.java:1434)
at android.view.View.layout(View.java:14817)
at android.view.ViewGroup.layout(ViewGroup.java:4631)
at android.widget.FrameLayout.layoutChildren(FrameLayout.java:453)
No any other changes in sources. What it could be?
Hi,
this lib has saved me! Thank you
why the video does not fill the container, even if is set to match_parent both for width and height?
thanks
hope can add full screen support
Thank you very much for your great job
When using VideoView you can do this:
Uri video = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.your_raw_file); //do not add any extension
//if your file is named sherif.mp4 and placed in /raw
//use R.raw.sherif
videoHolder.setVideoURI(video);
This doesn't work on ExoMedia. An exception is thrown:
com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to android.resource://com.njrexperience.android/2131165185
player = new EMAudioPlayer(this);
String path = "http://hitzfm2.serverhostingcenter.com:8920/;";
Uri uri = Uri.parse(path);
player.setAudioStreamType(AudioManager.STREAM_MUSIC);
player.setDataSource(getContext(), uri, MediaUtil.MediaType.MP3);
player.prepareAsync();
player.start();
I can stream the audio in Android 5.0, but not in Android 4.
i got the error as below.
Internal track renderer error. com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to http://hitzfm2.serverhostingcenter.com:8920/;
at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:154)
at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:145)
at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:283)
at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:205)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
Caused by: com.google.android.exoplayer.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to http://hitzfm2.serverhostingcenter.com:8920/;
at com.google.android.exoplayer.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:193)
at com.google.android.exoplayer.upstream.DefaultUriDataSource.open(DefaultUriDataSource.java:136)
at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractingLoadable.load(ExtractorSampleSource.java:733)
at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:209)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.net.ProtocolException: Unexpected status line: ICY 200 OK
at com.android.okhttp.internal.http.RawHeaders.setStatusLine(RawHeaders.java:108)
at com.android.okhttp.internal.http.RawHeaders.fromBytes(RawHeaders.java:308)
at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:135)
at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:644)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
at com.google.android.exoplayer.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:351)
at com.google.android.exoplayer.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:191)
at com.google.android.exoplayer.upstream.DefaultUriDataSource.open(DefaultUriDataSource.java:136)
at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractingLoadable.load(ExtractorSampleSource.java:733)
at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:209)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
First off, want to say that this is a fantastic library!
During video playback, the EMVideoView is not keeping the device awake. Looking at the source, it appears that the start() function calls EMExoPlayer.setPlayWhenReady(), which calls stayAwake(). However, wakeLock in EMExoPlayer is null, so stayAwake() does nothing.
Not sure if that's a bug or is intended, but it would be nice if that can be fixed or have the EMExoPlayer.setWakeMode function be exposed in EMVideoView.
I executed the sample, played an Audio Track, I can see the notification with the player controls, but when I lock the phone, I don't see the background image or the controls on the lock screen.
On the Demo app, if I play a video and put the app in the background , I can still listen to the audio but the notification disappears, how to avoid this?
When rotating the device using the demo video playback, the black shutters (bars along the sides) aren't resized, leaving white bars along the sides instead of the expected black
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.marti.tv/com.example.marti.tv.ShowVideoExoActivity}: android.view.InflateException: Binary XML file line #6: Error inflating class com.devbrackets.android.exomedia.EMVideoView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2358)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.devbrackets.android.exomedia.EMVideoView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:757)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:429)
at android.app.Activity.setContentView(Activity.java:2145)
at com.example.marti.tv.ShowVideoExoActivity.onCreate(ShowVideoExoActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.devbrackets.android.exomedia.EMVideoView" on path: DexPathList[[zip file "/mnt/asec/com.example.marti.tv-1/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at android.view.LayoutInflater.createView(LayoutInflater.java:571)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:429)
at android.app.Activity.setContentView(Activity.java:2145)
at com.example.marti.tv.ShowVideoExoActivity.onCreate(ShowVideoExoActivity.java:16)
at android.app.Activity.performCreate(Activity.java:5990)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2311)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2420)
at android.app.ActivityThread.access$900(ActivityThread.java:154)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1321)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Suppressed: java.lang.NoClassDefFoundError: com.devbrackets.android.exomedia.EMVideoView
at dalvik.system.DexFile.defineClassNative(Native Method)
at dalvik.system.DexFile.defineClass(DexFile.java:226)
at dalvik.system.DexFile.loadClassBinaryName(DexFile.java:219)
at dalvik.system.DexPathList.findClass(DexPathList.java:321)
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:54)
... 24 more
Suppressed: java.lang.ClassNotFoundException: com.devbrackets.android.exomedia.EMVideoView
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 23 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available
Hello
First of all, thanks for this library, its awesome and makes it easier to use the ExoPlayer.
I have an issue on android phones with version lower than lolipop, the video doesn't rotate correctly. On lollipop it works perfectly. Actually there is a bug from the ExoPlayer repo: google/ExoPlayer#91, they suggest to rotate the video using this listener:
public void onVideoSizeChanged(int width, int height, int unAppliedRotationDegrees, float pixelWidthHeightRatio);
So, not sure if this is something you can fix or should wait for the ExoPlayer team to fix it.
Thanks!
Current version of EMExoPlayer.java isnr aqquiring and releasing the wake lock specified by setWakeMode(), so effectively wake locks set by setWakeMode() are ignored.
Have a look at the Android MediaPlayer source. You need to have a funkction like
private void stayAwake(boolean awake) {
if (mWakeLock != null) {
if (awake && !mWakeLock.isHeld()) {
mWakeLock.acquire();
} else if (!awake && mWakeLock.isHeld()) {
mWakeLock.release();
}
}
mStayAwake = awake;
updateSurfaceScreenOn();
}
and add calls to stayAwake() in start(), stop() etc.
Hello,
thank you for this great library which make work with ExoPlayer much easier.
I am dealing with issue of clipping the video when streaming from an HSL stream. After some time (in case of my stream it is after 8 seconds) the video gets clipped. I am testing this on a phone with Android 5.0.1. You can see the changes on on these pictures: http://imgur.com/a/vUT6C
First picture shows the full screen video right after the stream starts, everything is how it supposed to be. Second image shows how the video gets clipped after first 8 seconds of playback. I have enabled the layout bounds so you can see it clearly.
You can try this same issue with this HSL stream video (in this case it got clipped after 20 seconds of video): http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8
This issue happends when onVideoSizeChanged event is called (in my case when the video size is changed to higher resolution).
Is there any way how to avoid this issue? Not sure if its and issue of ExoPlayer configuration or the ExoMedia view.
Thank you for your assistance, Vit Veres
Do you have anything planned for Chromecast support?
Seems like it would fit i EMPlayListService
or as an alternative service with some shared logic.
Hi,
I notice there is a static variable PlayListManager that will be used in the AudioPlayerActivity.java
Each time this method invoked in the AudioPlayerActivity
playlistManagerAudioActivity.play(selectedIndex, false);
The AudioService.class will be started.
I followed the demo and it works fine for one playlist.
However, if I have multiple playlist then should I :
What do you think?
Thank
Hi,
First of all thanks for the library. simplified a lot of things for me.
But I think it's on it's way to become a spaghetti monster.
Overall a lot of things are working good, but trying to extend, or work around is very difficult.
My first concern is about the controls: Right now there's 3(!) different ways to control the video view - Default controls, Callbacks AND EventBus. This is too much. It makes following the code of the library extremely confusing.
Now about the Default controls being embedded inside the view - it looks like a very bad design. There's no way for them to work outside of the EMVIdeoView, so while they work perfectly inside your code, extracting them outside and trying to build custom controls is very tiresome. Of course it's not meant to be outside, but there's not reason to put it all over the VideoView when they can perfectly control it from the outside - the same way we would implement it - callbacks OR events.
Now as a consequence of embedding the default controls in the video view - it now has a lot of method delegation to the controls - e.g. setPlayPauseImages
instead of having a #getDefaultControls().setPlayPauseImages
Next, there's so many events and callbacks, it's hard to tell what is coming from where. when dealing with these view-controllers, there should be a distinction of event emitters - meaning EMMediaPlayPauseEvent
should only be triggered by one of the mediaplayer/videoview OR the controls. What happens now is a mix & match - some events are triggered by the EMVideoView, some by the controls - and the don't sync!
for example in DefaultControls.java:
protected void onPlayPauseClick() {
if (callback != null && callback.onPlayPauseClicked()) {
return;
}
if (bus != null) {
bus.post(new EMMediaPlayPauseEvent()); // OLD DATA
if (busPostHandlesEvent) {
return;
}
}
//toggles the playback
boolean playing = videoView.isPlaying();
if (playing) {
videoView.pause();
} else {
videoView.start();
}
}
When I register to a EMMediaPlayPauseEvent
and it triggers, I expect that a video was paused or played - but this is a controls click event, before we called videoView.pause()
. so to act upon this event I HAVE TO handle the event myself using setFinishOnBusEvents
, thus having to handle ALL the events myself.
There's actually more examples but this is too of a long rant, and I'm sure you know all this already!
Just trying to start a discussion around this since fixing even some of these is 100% breaking changes, and that should be handled (not written, just handled) by the library author. I want to see if there's support for this from the author since I don't have much time to write these by myself, and want to make sure if this happens it could be in sync with the core features and not fall behind, since I do need the improvements which aren't related to UI and structure.
Thanks again!
Hi.
I tried newest version 2.3.3 and I found that when I press notification on status bar it's not open my activity like version 2.3.2.
Please help me fix the problem.
Thanks.
Any way this could be deployed to Nuget for Xamarin.Droid use? Would really appreciate it. There is a player control already but no view wrapper: http://www.nuget.org/packages?q=exoplayer
It seems current version of ExoMedia uses ExoPlayer r1.4.2. My project add ExoPlayer r1.5.2 before I know ExoMedia. I just add
compile 'com.devbrackets.android:exomedia:2.3.1'
to build.gradle
along with
compile 'com.google.android.exoplayer:exoplayer:r1.5.2'
It throw exception on runtime at this:
Caused by: java.lang.NoSuchMethodError: No virtual method register()V in class Lcom/google/android/exoplayer/audio/AudioCapabilitiesReceiver; or its super classes (declaration of 'com.google.android.exoplayer.audio.AudioCapabilitiesReceiver' appears in /data/app/com.ffd.hg.xr.debug-1/base.apk)
at com.devbrackets.android.exomedia.EMVideoView.setupExoPlayer(EMVideoView.java:213)
at com.devbrackets.android.exomedia.EMVideoView.initView(EMVideoView.java:205)
Is there any way that i can rotate the video view without sufferring from state loss?
I've tried using setRotation and also from xml.
I am show an EMVideoView in a dialog fragment and would like to rotate that by 90 degrees. However I just get a transparent background instead of a video then.
Is there a correct way to rotate ? Is rotation possible?
Hi.
I running demo everything work well except Lock screen feature. Not show artwork, media buttons on Lock screen.
Nexus 5, Lollipop 5.1.1
Hi, I'm having issue while try to stream on a URL
Uri uri = Uri.parse("http://shout01.stream.hostworks.com.au/3aw");
EMAudioPlayer player = new EMAudioPlayer(this);
player.setDataSource(this, uri, MediaUtil.MediaType.SMOOTH_STREAM);
player.prepareAsync();
player.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mp.start();
}
});
Error:
12-23 23:54:46.577 25725-25756/? E/ExoPlayerImplInternal: Internal track renderer error.
com.google.android.exoplayer.ExoPlaybackException: com.google.android.exoplayer.upstream.HttpDataSource$HttpDataSourceException: Unable to connect to http://shout01.stream.hostworks.com.au/3aw
at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:154)
at com.google.android.exoplayer.SampleSourceTrackRenderer.maybeThrowError(SampleSourceTrackRenderer.java:145)
at com.google.android.exoplayer.ExoPlayerImplInternal.incrementalPrepareInternal(ExoPlayerImplInternal.java:283)
at com.google.android.exoplayer.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:205)
at android.os.Handler.dispatchMessage(Handler.java:98)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.google.android.exoplayer.util.PriorityHandlerThread.run(PriorityHandlerThread.java:40)
Caused by: com.google.android.exoplayer.upstream.HttpDataSource$HttpDataSourceException:
Unable to connect to http://shout01.stream.hostworks.com.au/3aw
at com.google.android.exoplayer.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:193)
at com.google.android.exoplayer.upstream.DefaultUriDataSource.open(DefaultUriDataSource.java:136)
at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractingLoadable.load(ExtractorSampleSource.java:733)
at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:209)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
Caused by: java.net.ProtocolException: Unexpected status line: ICY 200 OK
at com.android.okhttp.internal.http.RawHeaders.setStatusLine(RawHeaders.java:108)
at com.android.okhttp.internal.http.RawHeaders.fromBytes(RawHeaders.java:308)
at com.android.okhttp.internal.http.HttpTransport.readResponseHeaders(HttpTransport.java:135)
at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:644)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:347)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:503)
at com.google.android.exoplayer.upstream.DefaultHttpDataSource.makeConnection(DefaultHttpDataSource.java:351)
at com.google.android.exoplayer.upstream.DefaultHttpDataSource.open(DefaultHttpDataSource.java:191)
at com.google.android.exoplayer.upstream.DefaultUriDataSource.open(DefaultUriDataSource.java:136)
at com.google.android.exoplayer.extractor.ExtractorSampleSource$ExtractingLoadable.load(ExtractorSampleSource.java:733)
at com.google.android.exoplayer.upstream.Loader$LoadTask.run(Loader.java:209)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
at java.lang.Thread.run(Thread.java:841)
First Up, Great Job with the Library. It's really helpful.
I am facing a small issue with the Video Playback. While playing a HLS stream, if I press the Home button the audio continues to play in the background. Is there a method that can be called to stop playback when user hits the home button during playback?
Hello brianwernick,
We were using setOnCompletionListener
to rewind the video once it ends and we noticed this listener would only be called the first time the video is completed.
As a workaround we are now using the addExoPlayerListener
with playbackstate ExoPlayer.STATE_ENDED
i need setlooping method like media player.
how can i implement?
When i add
compile 'com.devbrackets.android:exomedia:2.5.0'
to my dependencies in gradle it causes xml theme errors:
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
I'm using appcombat support library v7:22.2.1 and targeting SDK 22
Any idea of what's happening?
I have a simple doubt: how can I ensure that the DASH streaming is being used on Android 4.0 and above? I didn't find any method to set the protocol or get information about what is being used.
Thanks for any help
When playing tracks the Audio Service updates the notification and lock screen with a given Image , By mistake I was not resizing my images and it was loading an 1080x1080 image , so after playing some tracks and changing this images a few times, I got an OOM.
I reckon the Bitmaps are not being recycled properly?
I just made a temporarely fix by resizing the bitmaps when loading them but I believe this will just delay the OOM.
I am not sure if keeping the BItmap references on the AudioService might be causing this??
For example:
http://livestreams.omroep.nl/live/npo/tvlive/ned1/ned1.isml/Manifest
This is a live smooth streaming URL.
java.lang.IllegalStateException: Handler (android.os.Handler) {ed82dba} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:325)
at android.os.Handler.enqueueMessage(Handler.java:631)
at android.os.Handler.sendMessageAtTime(Handler.java:600)
at android.os.Handler.sendMessageDelayed(Handler.java:570)
at android.os.Handler.sendMessage(Handler.java:507)
at android.os.Message.sendToTarget(Message.java:416)
at com.google.android.exoplayer.ExoPlayerImplInternal.prepare(ExoPlayerImplInternal.java:132)
at com.google.android.exoplayer.ExoPlayerImpl.prepare(ExoPlayerImpl.java:99)
at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer.onRenderers(EMExoPlayer.java:285)
at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer$InternalRendererBuilderCallback.onRenderers(EMExoPlayer.java:601)
at com.devbrackets.android.exomedia.builder.RenderBuilder.buildRenderers(RenderBuilder.java:95)
at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer.prepare(EMExoPlayer.java:246)
at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer.replaceRenderBuilder(EMExoPlayer.java:146)
at com.devbrackets.android.exomedia.EMVideoView.setVideoURI(EMVideoView.java:642)
at com.devbrackets.android.exomedia.EMVideoView.setVideoURI(EMVideoView.java:624)
mTitle.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
mEmVideoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
@Override
public void onPrepared(MediaPlayer mp) {
mEmVideoView.start();
}
});
mEmVideoView.setVideoURI(Uri.parse("http://.....................mp4"));
}
});
While on the play audio screen, close notification, the player stops playing normally. If click play button on the play screen, error occur.
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Class.getName()' on a null object reference
at android.content.ComponentName.<init>(ComponentName.java:78)
at android.content.Intent.<init>(Intent.java:4160)
at com.devbrackets.android.exomedia.EMNotification.createPendingIntent(EMNotification.java:299)
at com.devbrackets.android.exomedia.EMNotification.getCustomNotification(EMNotification.java:213)
at com.devbrackets.android.exomedia.EMNotification.getNotification(EMNotification.java:172)
at com.devbrackets.android.exomedia.service.EMPlaylistService.setupForeground(EMPlaylistService.java:803)
at com.devbrackets.android.exomedia.service.EMPlaylistService.performPlay(EMPlaylistService.java:758)
at com.devbrackets.android.exomedia.service.EMPlaylistService.performPlayPause(EMPlaylistService.java:535)
at com.devbrackets.android.exomedia.service.EMPlaylistService.handleRemoteAction(EMPlaylistService.java:1130)
at com.devbrackets.android.exomedia.service.EMPlaylistService.onStartCommand(EMPlaylistService.java:374)
Thank You For Your Greate Job.
EMVideoView have problem in RecycleView , Can not Play.
Best Wishes!
Hi,
I'm currently using 'Android-ScalableVideoView' library but I need to use your library too. The problem is I don't know how to set CENTER_CROP for the video view and I need more listeners such as setOnBufferingUpdateListener
.
Hi @brianwernick
Thanks for your great library. I want to know is it possible to add custom view to media-controller ? ( in fact I want to add another buttons like full-screen in media-controller )
When setting wake mode, consider also getting a wifi lock if the datasource is a remote URI.
I use this function with URL & drawable but didn't work ( Nexus 5 , Android 6.0 )
here is my code :
emVideoView = (EMVideoView) findViewById(R.id.video_play_activity_video_view);
emVideoView.setPreviewImage(getResources().getDrawable(R.drawable.ic_test));
emVideoView.setOnPreparedListener(this); emVideoView.setVideoURI(Uri.parse("https://archive.org/download/Popeye_forPresident/Popeye_forPresident_512kb.mp4"));
Sometimes I get this stack trace
Handler (android.os.Handler) {1d54aa83} sending message to a Handler on a dead thread
java.lang.IllegalStateException: Handler (android.os.Handler) {1d54aa83} sending message to a Handler on a dead thread
at android.os.MessageQueue.enqueueMessage(MessageQueue.java:325)
at android.os.Handler.enqueueMessage(Handler.java:631)
at android.os.Handler.sendMessageAtTime(Handler.java:600)
at android.os.Handler.sendMessageDelayed(Handler.java:570)
at android.os.Handler.sendMessage(Handler.java:507)
at android.os.Message.sendToTarget(Message.java:416)
at com.google.android.exoplayer.ExoPlayerImplInternal.setPlayWhenReady(ExoPlayerImplInternal.java:140)
at com.google.android.exoplayer.ExoPlayerImpl.setPlayWhenReady(ExoPlayerImpl.java:145)
at com.devbrackets.android.exomedia.exoplayer.EMExoPlayer.setPlayWhenReady(EMExoPlayer.java:255)
at com.devbrackets.android.exomedia.EMVideoView.pause(EMVideoView.java:877)
at com.devbrackets.android.exomedia.widget.DefaultControls.onPlayPauseClick(DefaultControls.java:508)
at com.devbrackets.android.exomedia.widget.DefaultControls$2.onClick(DefaultControls.java:455)
at android.view.View.performClick(View.java:4789)
at android.view.View$PerformClick.run(View.java:19881)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5294)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)
Is it possible to catch this issue and restart/reset the player?
Hello
I want to thank you for your hard work.
I fail to make it work .flv, or not supported by exoplayer?
Thanks for your nice work!
I think it's better when have feature set width height ratio for EMVideoView.
And could you make a demo about fullscreen playback. E.g click button -> fullscreen mode; click back -> normal mode.
I don't know why ExoMedia don't support setMediaController. Can you improve it and make this compatible?
Another issue I faced is the next button and previous button are shown in not correctly.
Both in AudioPlayerActivity and the foreground notification, in my device Android 5.0 both button not shown in correct shape I was forced to download both images from ExoMedia and put locally then it works fine.
so I can change fine both button for the AudioPlayerActivity but not the foreground notification.
Do you happen to know the reason ?
Thank
Is there any specific proguard config that can be sued?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.