Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Android : Crash when using JwPlayer in Recyclerview


java.util.ConcurrentModificationException
at java.util.ArrayList$Itr.next(ArrayList.java:831)
at com.longtailvideo.jwplayer.core.c.d.a(SourceFile:215)
at com.longtailvideo.jwplayer.core.d.c.onPageFinished(SourceFile:101)
at com.android.webview.chromium.WebViewContentsClientAdapter.onPageFinished(WebViewContentsClientAdapter.java:196)
at org.chromium.android_webview.AwContentsClientCallbackHelper$MyHandler.handleMessage(AwContentsClientCallbackHelper.java:70)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6123)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:757)

I have got this exception when I am using JwPlayer in Recyclerview.

2 Community Answers

s...

User  
-1 rated :

Edit: https://github.com/jwplayer/jwplayer-android-best-practice-apps/issues/12

George

JW Player Support Agent  
0 rated :

Hello Sairam,

This is George, I am the Android Support Engineer here at JW Player. How are you? I see here you’re trying to load the JWPlayerView into a RecyclerView.

Unfortunately, this is not a supported use case, mainly for 3 reasons:

1) Hardware limitations to load multiple video players at once. Please refer to the GitHub comment below for a more detailed explanation:
https://github.com/google/ExoPlayer/issues/273#issuecomment-72432393

2) Fullscreen behavior. Since there are multiple players instantiated and there’s no good way to know which instances are available and which instance should go fullscreen when the device is rotated. Also, due to the nature of fullscreen functionality, the player is still in a scrollable container which sometimes results in a player that is taking up the full device screen, but the user is able to scroll off of the player.

3) We use a SurfaceView to render the video as it is a requirement for DRM. SurfaceView’s don’t perform well in Scrollable containers.

Our team is looking into building out this feature in the future, but there is no timeline for it as of yet. I will be sure to add your request to the existing feature request for our product team to review.

Please let me know if you have any other questions or concerns.

Sincerely,
George
JW Player
Android Support Engineer

This question has received the maximum number of answers.