android-videoview

How to determine video width and height on Android

大城市里の小女人 提交于 2019-12-02 20:34:17
I have a video file and I want to get width and height of video. I don't want to play it, just to get size. I've tried to use MediaPlayer: MediaPlayer mp = new MediaPlayer(); mp.setDataSource(uriString); mp.prepare(); int width = mp.getVideoWidth(); int height = mp.getVideoHeight(); but it returns 0 for width and height, because VideoSizeChangedEvent didn't fire yet. How can I get width and height of video? UPD: I need API version 7 This works in API level 10 and up: MediaMetadataRetriever retriever = new MediaMetadataRetriever(); retriever.setDataSource("/path/to/video.mp4"); int width =

Android TextureView vs VideoView Performance

不羁的心 提交于 2019-12-02 17:41:14
I need to be able to rotate a video on screen, so I created a custom TextureView which provides a convenience layer over a MediaPlayer similar to how the current implementation of VideoView does. This Android blog post says the following about TextureView: Because a SurfaceView’s content does not live in the application’s window, it cannot be transformed (moved, scaled, rotated) efficiently. This makes it difficult to use a SurfaceView inside a ListView or a ScrollView. SurfaceView also cannot interact properly with some features of the UI toolkit such as fading edges or View.setAlpha(). To

videoview for large video

为君一笑 提交于 2019-12-02 17:23:31
问题 VideoView vv = (VideoView)this.findViewById(R.id.screen_video); Uri uri = Uri.parse(URL); vv.setVideoURI(uri); vv.start(); I use above code to play video file. I play a small video successly. But when I try to play a large video. It was Failure. The file is can be play by my phone. How to play a large video file with videoview? Or what limitation of videoview has? I didn't see any error in logcat. But it also didn't show the buffering percentage. 回答1: I don't know (and I could not find) clear

Does Android support scaling Video?

筅森魡賤 提交于 2019-12-02 16:39:55
Using a VideoView is it possible to set a scale factor for Android? By Default the video view resizes itself to fit the encoded resolution of the Video. Can I force Android to render a video into a smaller or larger rect? By Default the video view resizes itself to fit the encoded resolution of the Video. VideoView (or the SurfaceView for use with MediaPlayer ) will be the size you tell it to be in your layout. Within that space , the video will play back as large as possible while maintaining the aspect ratio. Can I force Android to render a video into a smaller or larger rect? Yes: make your

Seamless video Loop with VideoView

坚强是说给别人听的谎言 提交于 2019-12-02 16:03:23
I have the following code to take a video as a raw resource, start the video and loop it but I need the video to loop seamlessly as of now when it comes to an end of the clip and starts the clip again the transition between causes a flicker for a split second, which I really can't have for my app. public class Example extends Activity { VideoView vv; /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); vv = (VideoView)findViewById(R.id.VideoView01); //Video Loop vv

Android Video Streaming using Video View (video view not showing automatially)

Deadly 提交于 2019-12-02 13:13:53
问题 I have managed to stream video from internet using Video View Uri uri=Uri.parse(videoFileList[0]); VideoView vv=(VideoView) this.findViewById(R.id.vv); vv.setVisibility(1); vv.bringToFront(); vv.setVideoURI(uri); vv.setMediaController(new MediaController(this)); vv.requestFocus(); But the video page displays as blank at first. Only if I click on the blank space the video view appeares. Can any body give a solution to display it automatically? 回答1: Try this. It worked for me. void playvideo

videoview for large video

独自空忆成欢 提交于 2019-12-02 11:37:25
VideoView vv = (VideoView)this.findViewById(R.id.screen_video); Uri uri = Uri.parse(URL); vv.setVideoURI(uri); vv.start(); I use above code to play video file. I play a small video successly. But when I try to play a large video. It was Failure. The file is can be play by my phone. How to play a large video file with videoview? Or what limitation of videoview has? I didn't see any error in logcat. But it also didn't show the buffering percentage. I don't know (and I could not find) clear specifications for videoview to play a video of a certain size. But to me it depends on the device and on

VideoView in eclipse not playing on phone

我的梦境 提交于 2019-12-02 11:06:16
问题 I put a videoview in eclipse for an android app but the video will not play on my phone. package test.test; import android.app.Activity; import android.net.Uri; import android.os.Bundle; import android.widget.MediaController; import android.widget.VideoView; public class graphics extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); VideoView videoView = (VideoView) findViewById(R.id.test);

how to play .3GP video file in android

只愿长相守 提交于 2019-12-02 10:08:14
HI i want to play a .3GP video file in android phone. i tried below code but it shows cant play video.so please tell me what i will do This is my code public class VideoPlay extends Activity { private String path ; private VideoView mVideoView; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); setContentView(R.layout.videoplay); path="http://www.boodang.com/api/videobb/101009_Pure.3gp"; mVideoView = (VideoView) findViewById(R.id.video); if (path == "") { // Tell the user to provide a media file URL/path. Toast.makeText( VideoPlay.this, "Please edit VideoViewDemo Activity,

Support different video sizes for Android

僤鯓⒐⒋嵵緔 提交于 2019-12-02 09:20:20
I am creating an App that is playing a video (as splash screen) but I am confused which are the correct sizes for each different screen. I have already checked a lot of answers (this link was indeed helpful but still not clear) and official documentations but it is still confusing me. I created the following folders: raw-ldpi, raw-mdpi, raw-hdpi, raw-xhdpi, raw-xxhdpi, raw-xxxhdpi BUT what are the correct video sizes for each of the above different folder? For example for raw-ldpi what are the correct video dimensions? (i.e 240 x 360) I found out the following resolutions from this site and