Questions tagged [android-videoview]

An Android View to manage and display a video file.

The VideoView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling and tinting.

Methods of this class

void setVideoPath(String pth): This method will set the absolute path of the video file which is going to be play.

void setMediaController(MediaController cntlor): This method is used to set the controller for the controls of playback .

void start(): This method is used to start the playback of video file.

void pause(): This method is used to pause the current playback.

boolean canPause(): This method will tell whether video view is able to pause.

boolean canSeekForward(): This method will return true value if video view is able to seek forward.

int getDuration(): This method is used to get the total duration of video view.

boolean isPlaying(): This method will return true value if the current video view is in play state.

void resume(): This method is used to play the resumed file.

2566 questions
15
votes
6 answers

Android VideoView crop_center

I have a RelativeLayout
Vladyslav Matviienko
  • 10,610
  • 4
  • 33
  • 52
15
votes
5 answers

Fullscreen video player - mediacontroller behind navigation bar

I have a problem with mediacontroller which is hidden behind navigation bar (soft navigation keys on ICS). At first is OK (first picture), but when is navigation bar hidden for the first time, mediacontroller is resized to fit screen (correct), but…
zoki
  • 535
  • 1
  • 3
  • 17
15
votes
1 answer

Play video one after another simultaneously smoothly [without visible switching from one to another]

I am new to android and want to play videos one after another simultaneously so that it looks like continuous video. I have found this link on stackoverflow very helpful. how-to-play-videos-one-after-another-simultaneously When I am using this then…
piku
  • 333
  • 1
  • 4
  • 15
15
votes
2 answers

How can i view a video inside a videoview at some specific position?

I am currently trying to implement a videoview that will show a video on a specific position. I can show a fullscreen video with no problem. However whenever i try to show that video inside a frame( a little rectangle for example ) I can only show a…
denizt
  • 713
  • 5
  • 21
14
votes
5 answers

How to play multiple video files simultaneously in one layout side by side in different view in Android

In Android, I created a layout with three surface view side by side, and I want to play one video file with different media player simultaneously. But one problem I faced that none of three can play that video simultaneously. One or two of them…
14
votes
2 answers

Live Video Stream between two Android Phones

I am currently working on video streaming between two Android Phone. I wrote an application which is able to record the video to the sd file (Using MediaRecorder); and I wrote another application which is able to display the video of the file. Both…
Will W
  • 151
  • 1
  • 1
  • 4
14
votes
1 answer

Android: Cannot set VideoView background to transparent

I have a VideoView playing a video whose shape is not rectangular, (i.e. a rotating cylinder with rounded corners). The videoview is displayed within a LinearLayout that has a background colour. I would like the background of the videoview to be…
14
votes
6 answers

How to play videos from SD Card

I was creating a simple app which stream videos from net and I made it but now I want to change the code so that I can play video files from my SDCard original code: Uri vidFile = Uri.parse("MY SITE HERE"); VideoView videoView = (VideoView)…
Mohit
  • 1,045
  • 4
  • 18
  • 45
13
votes
3 answers

Android, how can I remove controls of VideoView?

In my project I have a Video View that I put it in splash screen. Everything is OK and I can see it in splash screen but the problem is when it shows, control bar (back, next, time length) will show as well that I want see it. How can I disable…
Hesam
  • 52,260
  • 74
  • 224
  • 365
13
votes
3 answers

Android::VideoView inside a ScrollView

I have a VideoView that is inside a scrollView. When I scroll the scrollView, the VideoView does not scroll with it. It is like its position is fixed. How can I scroll the VideoView correctly with the scrolling of all other elements in the…
George
  • 3,727
  • 9
  • 31
  • 47
13
votes
3 answers

VideoView onTouch events: pause/resume video, and show/hide MediaController and ActionBar

Question summary: 1) How to first display the video as paused, and not play it immediately? 2) How to pause/un-pause the video on touch, and also hide/show the ActionBar and MediaController. I'd appreciate any advice. Thanks! (Relevant Code is…
pez
  • 3,859
  • 12
  • 40
  • 72
13
votes
5 answers

Can VideoView be detach and reattached without stopping the stream?

I'm building an app where the user clicks on a button to show a video full screen. Initially the video is attached to a view inside a ViewPager. To be able to show it fullscreen I detach it from its parent and reattach it to the root view. This…
Thierry Roy
  • 8,452
  • 10
  • 60
  • 84
13
votes
3 answers

Show and hide a play button over a VideoView in Android

I want to be able to show a button to start a video, centered inside the same view where the video will play (with a VideoView). I also want the button to disappear after I click it, since I'm using the MediaController class to perform Pause,…
Joe Fernandez
  • 4,781
  • 4
  • 26
  • 23
13
votes
4 answers

Android VideoView not playing Portrait Orientation

THE PLATFORM: Developing in Eclipse using Android SDK 16. THE PROBLEM: I have a VideoView element that is supposed to fill the entire screen in 480x800 (PORTRAIT ORIENTATION) and it plays fine, but will not orient to portrait. It sticks in…
Rick Scolaro
  • 485
  • 1
  • 10
  • 28
12
votes
3 answers

Streaming to VideoView only plays on Wifi when using Samsung phones

I am using the following library to stream YouTube videos to an Android application. http://code.google.com/p/android-youtube-player/source/browse/trunk/OpenYouTubeActivity/src/com/keyes/youtube/OpenYouTubePlayerActivity.java?r=3 I am successfully…
Oh Danny Boy
  • 4,857
  • 8
  • 56
  • 88