On my button click I wrote the following code for playing video from my SDCARD (mp4).
video_view = (VideoView)findViewById(R.id.video_view); video_view.setVideoPath("/sdcard/myvideo.mp4"); video_view.setMediaController(new MediaController(this)); video_view.start();
I can play recorded video from SDCARD in player.
- But when I run it on my application in videoview I can hear only sound.
- Problem : I am not able to see the video.
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
- Android OverlayItem.setMarker(): Change the marker
Can you give this a try?
SOLUTION 1:
this will set the videoview to the top layer; In other words: block everything under it.
SOLUTION 2:
SOLUTION 3:
sometimes this is related about your apptheme; In my case, I changed the apptheme from
@style/AppTheme
to@android:style/Theme.NoTitleBar.Fullscreen
fix my problem.My solution was placing the VideoView control at top of the layout and no matter if you set the visibility property.
This work for me on a S6 with Android 6.0
I faced the same issue, my video view resized to the expected video resolution but there is nothing on the screen. I tried to use above mentioned solutions but nothing worked.
I tried to set the visibility and that worked, not sure why. This might help someone who come across this post and is facing an issue like me
Here is my XML, not sure why visibility was an issue.
I think you use bad mp4 format. Uses Android specific mp4 format!!!
I've tried every method above, but none of them could work.
Finally, I tried to call this function, then the video appeared.
Hope this also works for you.