Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting errors on API 18 and 19 #86

Open
devingDev opened this issue Jun 18, 2018 · 3 comments
Open

Getting errors on API 18 and 19 #86

devingDev opened this issue Jun 18, 2018 · 3 comments

Comments

@devingDev
Copy link

devingDev commented Jun 18, 2018

Trying out my app on older versions for compat check I saw that it does not play videos. The thumbnail gets hidden once the video is about to start to play.

some errors I saw in logcat :
`E/BufferQueue: [unnamed-3021-1] setDefaultBufferSize: dimensions cannot be 0 (w=0, h=0)

E/MediaPlayer: error (1, -2147483648)

E/MediaPlayer: Should have subtitle controller already set
Error (1,-2147483648)

E/MediaPlayer: start called in state 0

W/System.err: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:6094)
at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:857)
at android.view.ViewGroup.invalidateChild(ViewGroup.java:4320)
at android.view.View.invalidate(View.java:10935)
at android.view.View.setFlags(View.java:8916)
at android.view.View.setVisibility(View.java:6036)
at android.widget.ImageView.setVisibility(ImageView.java:1226)
at com.allattentionhere.autoplayvideos.AAH_CustomViewHolder.videoStarted(AAH_CustomViewHolder.java:36)
at com.myapp.deving.Adapter.MyVideosAdapter$MyViewHolder.videoStarted(MyVideosAdapter.java:99)
at com.allattentionhere.autoplayvideos.AAH_CustomViewHolder$1.call(AAH_CustomViewHolder.java:51)
at com.allattentionhere.autoplayvideos.AAH_CustomViewHolder$1.call(AAH_CustomViewHolder.java:48)
at com.allattentionhere.autoplayvideos.AAH_CustomVideoView.startVideo(AAH_CustomVideoView.java:72)
at com.allattentionhere.autoplayvideos.AAH_CustomViewHolder.playVideo(AAH_CustomViewHolder.java:32)
at com.allattentionhere.autoplayvideos.AAH_CustomRecyclerView$2.run(AAH_CustomRecyclerView.java:139)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.os.HandlerThread.run(HandlerThread.java:61)

E/MediaPlayer: Error (-38,0)`

I only tested with API 27 before so not sure why its doing this.
Edit: Gonna try API 21 next
Edit2: Same on API 21 .. nothing plays only those errors in log

@lucazin
Copy link

lucazin commented Jun 22, 2018

i have the same in this line
img_playback.setImageResource(R.drawable.ic_pause);

@devingDev
Copy link
Author

Did you try this on a real device? Because it seems to happen only on older emulator versions.
On android 4.2.2 a real device it worked !

@devingDev
Copy link
Author

Also your code shoulnt cause the mediaplayer to fail with that error code 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants