Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
364 views
in Technique[技术] by (71.8m points)

android - Video is not showing on VideoView but I can hear its sound

  • 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.

---- I tried following SO link but still no luck ----

  • link 1
  • link 2

  • Is anybody ever faced this kind of problem ? If yes then how can it solve it ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I've tried every method above, but none of them could work.

Finally, I tried to call this function, then the video appeared.

video_view.setZOrderOnTop(true);

Hope this also works for you.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...