jarvanmo / exovideoview Goto Github PK
View Code? Open in Web Editor NEWa simple video view for exoplayer
License: Apache License 2.0
a simple video view for exoplayer
License: Apache License 2.0
The minimum supported library is 17 can I override this and use for 14API?
用了setResizeMode不行啊.
when i am trying to play HD videos resolution 1080 or above from my sd card video is started everything is fine but when i am seek forward it will play from start position why? if i am try to pay that uri to exo player demo application then timebar is disable can anyone please help me to sort out this problem
So simple problem, and I can't google any ideas about this. Maybe I'm doing something wrong?
There is an ExoVideoView in a fragment, I start playing by
mVideoView.setUseController(false);
mVideoView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIT);
mVideoView.setRepeatToggleModes(RepeatModeUtil.REPEAT_TOGGLE_MODE_ALL);
mediaSource = new SimpleMediaSource("some url");
mVideoView.play(mediaSource, true);
mVideoView.getPlayer().setRepeatMode(RepeatModeUtil.REPEAT_TOGGLE_MODE_ALL);
Then, I pause playback with
mVideoView.pause()
it works fine. But then,
mVideoView.resume()
don't give any effect :-(
mVideoView.play(mediaSource, mVideoView.getPlayer().getCurrentPosition());
works fine, but playback is restored only after black blinking, which is not good.. Any ideas?
PS. When using Controller controls - pause/resume works fine. But i need Play/Pause button outside the fragment. Tried mVideoView.requestFocus() - not helped.
I just added gradle dependency, then added the ExoVideoView in my layout file and properly handled its working in the Java section. But this exception comes when I launch the activity that contains ExoVideoView.
Caused by: android.view.InflateException: Binary XML file line #15: Error inflating class com.jarvanmo.exoplayerview.ui.ExoVideoView
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.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:289)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.dozydroid.fmp.activities.VideoPlayerActivity.onCreate(VideoPlayerActivity.java:197)
at android.app.Activity.performCreate(Activity.java:5343)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331)
Here's peek from my build.gradle
compile 'com.google.android.exoplayer:exoplayer:r2.5.4'
compile 'com.jarvanmo:exoplayerview:1.1.0'
compile 'com.android.support:cardview-v7:26.+'
compile 'com.android.support:support-v4:26.+'
testCompile 'junit:junit:4.12'
My layout.xml
file:
<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"
android:keepScreenOn="true"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:background="#000"
tools:context=".activities.VideoPlayerActivity">
<com.jarvanmo.exoplayerview.ui.ExoVideoView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/player_view"
app:resize_mode="fit"/>
</RelativeLayout>
My Activity.java
file:
private ExoVideoView exoVideoView;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
exoVideoView = (ExoVideoView) findViewById(R.id.player_view);
exoVideoView.setPlayer(exoPlayer);
}
Full screen not work. also exoplayer r2.1.1 not support
that is 1x,1.5x,2x speed etc.
ERROR: Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.1] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to element at AndroidManifest.xml:5:5-19:19 to override.
Gradle sync failed: Could not find method compileOptions() for arguments [build_97ux8l4vqnh6xzchvcyv8ox6l$_run_closure2@646f9dbe] on project ':app' of type org.gradle.api.Project.
这个库写的还是非常666的,但是在使用上我跟百度云对比了下,体验上有以下几点建议:
其实这三个问题都是对View的添加和对View的触摸导致的。
{
"singleVideoInfo": [
{
"videoURLLow": "https://ips.ifeng.com/video19.ifeng.com/video09/2018/09/14/p2096778-102-009-065737.mp4?ifsign=1",
"videoURLMid": "https://ips.ifeng.com/video19.ifeng.com/video09/2018/09/14/p2096778-102-009-065737.mp4?ifsign=1",
"videoURLHigh": "https://ips.ifeng.com/video19.ifeng.com/video09/2018/09/14/p2096778-102-009-065737.mp4?ifsign=1"
}
]
}
How to add 3 video qualities?
I have tried sample code but its not working exactly.
例如播放rtsp://192.168.48.1/stream2 这是个车载行车记录仪的流 返回的错误是解析Url失败
Not able to play video on android 4.4. please look into this
first thanks for such a good library.
i want to pars url string from X activity to exovideoview Activity by Intent by i couldnt, can you please guide me how to do it?
and also how i can change quality of stream in playerView.
thanks
在小米2s上测试,感觉对比其他app的手势调节亮度和音量,不够平滑和流畅;而且有时候滑动了一段距离也没有反应,指示器也没显示
How to add subtitle ?
Hello mate!
Can you please tell me how to implement zoom gesture in video player like brightness and volume control?
i just added the player on project but after releasing version 2.0.0 i saw what i was searching for its playing the stream in different quality.
but this version of exo player show this error in while lunching in API 17 which is minimum sdk version of my project
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.jarvanmo.demo/com.jarvanmo.demo.SimpleVideoViewActivity}: android.view.InflateException: Binary XML file line #0: Error inflating class com.jarvanmo.exoplayerview.ui.ExoVideoView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class com.jarvanmo.exoplayerview.ui.ExoVideoView
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.jarvanmo.demo.SimpleVideoViewActivity.onCreate(SimpleVideoViewActivity.java:46)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.jarvanmo.demo.SimpleVideoViewActivity.onCreate(SimpleVideoViewActivity.java:46)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.view.InflateException: Binary XML file line #0: Error inflating class TextView
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.jarvanmo.exoplayerview.ui.ExoVideoPlaybackControlView.(ExoVideoPlaybackControlView.java:337)
at com.jarvanmo.exoplayerview.ui.ExoVideoView.(ExoVideoView.java:248)
at com.jarvanmo.exoplayerview.ui.ExoVideoView.(ExoVideoView.java:125)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.jarvanmo.demo.SimpleVideoViewActivity.onCreate(SimpleVideoViewActivity.java:46)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: android.content.res.Resources$NotFoundException: File res/drawable/ic_error_outline_white_48dp.xml from drawable resource ID #0x7f060067
at android.content.res.Resources.loadDrawable(Resources.java:1953)
at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
at android.widget.TextView.(TextView.java:754)
at android.support.v7.widget.AppCompatTextView.(AppCompatTextView.java:76)
at android.support.v7.widget.AppCompatTextView.(AppCompatTextView.java:72)
at android.support.v7.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
at android.support.v7.app.AppCompatDelegateImplV9.createView(AppCompatDelegateImplV9.java:1016)
at android.support.v7.app.AppCompatDelegateImplV9.onCreateView(AppCompatDelegateImplV9.java:1073)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:675)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at com.jarvanmo.exoplayerview.ui.ExoVideoPlaybackControlView.(ExoVideoPlaybackControlView.java:337)
at com.jarvanmo.exoplayerview.ui.ExoVideoView.(ExoVideoView.java:248)
at com.jarvanmo.exoplayerview.ui.ExoVideoView.(ExoVideoView.java:125)
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
at com.jarvanmo.demo.SimpleVideoViewActivity.onCreate(SimpleVideoViewActivity.java:46)
at android.app.Activity.performCreate(Activity.java:5104)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
at android.app.ActivityThread.access$600(ActivityThread.java:141)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5041)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
at dalvik.system.NativeStart.main(Native Method)
Caused by: org.xmlpull.v1.XmlPullParserException: Binar
视频全屏播放后过段时间点击右下角的还原到小窗口图标无反应。
Hi,
We tried to play video from local storage, but we couldn't play video.
Here is our code.
String FileNamePath = this.getApplicationInfo().dataDir + "/" + obj.FileName+".mp4";
mediaSource = new SimpleMediaSource(FileNamePath);
adVideo.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FIXED_WIDTH | AspectRatioFrameLayout.RESIZE_MODE_FIT);
adVideo.play(mediaSource);
Please tell us how to do it using your library.
com.google.android.exoplayer2.ui.PlayerView is a high level player which external libraries like https://github.com/eneim/toro use
Without this interface, it is impossible to use this library with others
On by S6 edge (android 7), when I'm in portrait mode, press full screen button and it switches to landscape mode but the bottom bottom controller is not replaced by bottom landscape controller. I have to press the fullscreen button again to change the controller view. Please have a check. Thank you.
app will freeze when video hasn't been loaded, if video link is broken, then the app will freeze, I suggest, the video should be loaded after entering the activity!
After adding this library I get
* What went wrong:
Execution failed for task ':ActivationEngineAndroid:mergeApptestactionDebugResources'.
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource compilation failed
/Users/kamend/.gradle/caches/transforms-2/files-2.1/dabb48aa5887f3be1cb323bc8c5a390c/res/values/values.xml:1104:5-1169:25: AAPT: error: duplicate value for resource 'attr/mode' with config ''.
/Users/kamend/.gradle/caches/transforms-2/files-2.1/dabb48aa5887f3be1cb323bc8c5a390c/res/values/values.xml:1104:5-1169:25: AAPT: error: resource previously defined here.
/Users/kamend/aeandroid3/ActivationEngineAndroid/build/intermediates/incremental/mergeApptestactionDebugResources/merged.dir/values/values.xml: error: file failed to compile.
What will that mean?
Hello,
How can i set the video title on runtime and update it?
I'm trying to play playlist and change the title according to the video being played.
Regards
how can i use fast fward and fast rewaind
Hello,
first of thanks for good project i learnt a lot from you.
i wanted add a backround service for playing audio stream of online Radio but i failed again and again.
can you help me in this case.
Getting this error after adding the dependency
implementation 'com.jarvanmo:exoplayerview:2.1.3'
AAPT: error: duplicate value for resource 'attr/textColor' with config ''.
Hi there, I've using your library in my project, recently I just detect one bug I think, for my case, when I clicked on each row, I need to request to api every time for get videoUrl for playing video, but when I click on multiple row the same time and the internet is a bit slow it make the video player initialize player slow too, so when I clicked on new row, I call the method stop and release the videoPlayer, but it can not stop, still playing, even If I close my player activity, It still hear the video sound.
I am not sure because of my implementation wrong or something with videoPlayer.
thank you
when quality changes video playes continuously without any issues but no sound..how to fix sound issue
hi how to hide back arrow exoplatervideoview?
Hi, do you plan to upgrade library to use exoplayer r2.4.0?
Help me with one of them
When Remove centerInfoWrapper clickListener then volume and brightness gesture not work.
with centerInfoWrapper clickListener gesture is work but play/pause other control not responding some time... can u explain me below about below function???
private void playOrPause() {
System.arraycopy(mHits, 1, mHits, 0, mHits.length - 1);
mHits[mHits.length - 1] = SystemClock.uptimeMillis();
if (500 > (SystemClock.uptimeMillis() - mHits[0])) {
controlDispatcher.dispatchSetPlayWhenReady(player, !player.getPlayWhenReady());
}
}
这里提出一点个人愚见,就是当视频在缓冲或者出现异常的时候,像暂停、返回、标题这些控件可以不出现,也就是缓冲和异常应该独立于Controller布局的。 不然明明在缓冲中,突然controller跟缓冲一起消失导致有种黑屏的感觉,体验不是很好!!!
when pressing back button in orientation portrait.
then it change the orientation from portrait to landscape then again landscape to portrait.
it is happening with me only or others also.
Sorry to ask How to detect when video play is complete
Thank!
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/google/android/exoplayer2/drm/DefaultDrmSessionManager$EventListener;
how to show quality option when player in portrait mode
.
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.