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
try this :
it may be help you...
You can do this
put the setZorderOnTop(true) method after you started the videoView, not before.
Here I am playing the video from one of the links.. It works perfectly for me.
Hope this helps..
I had this exact same issue except that I was adding my video view programmatically. I noticed while inspecting the view hierarchy that the parent ViewGroup had it's layer type set to software.
Since the codebase I work on is shared and I didn't notice that the layer type was being setting to software in a subclass of the parent ViewGroup.
So try setting the parent's views layer type to None or Hardware
The black screen and audio playing happened with me when I did not release the MediaPlayer object. When you play a video in Activity with media player you have to release it when activity is destroyed. And when you open it again a new instance of media player will be created and use the already released resources.
MediaPlayer.release();