android-video-player

Android's MediaPlayer setSurface while on paused state

£可爱£侵袭症+ 提交于 2019-12-04 06:50:33
EDIT : So apparently this has nothing to do with multiple activities, and this has something to do with the encoding of the video file. I will try to simplify the question: I have a MediaPlayer object in a paused state, when I call mediaPlayer.getCurrentPosition() I get a result which is accurate. When I call mediaPlayer.setSurface() (using a different surface) followed by mediaPlayer.play() on this object the video is played in a different position than the one returned by getCurrentPosition(). I am testing on API >= ICE_CREAM_SANDWICH. Tested both using a local resource in the project and

how can i play two video on one screen?

◇◆丶佛笑我妖孽 提交于 2019-12-03 10:16:06
i have to make an application where i need to play two video simultaniously,on screen. here is my code.but the video dose not play.am i doing wrong anywhere? :( public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); VideoView myVideoView = (VideoView)findViewById(R.id.myvideoview); myVideoView.setVideoURI(Uri.parse(SrcPath)); myVideoView.setMediaController(new MediaController(this)); myVideoView.requestFocus(); myVideoView.start(); VideoView myVideoView2 = (VideoView)findViewById(R.id.myvideoview2); myVideoView2.setVideoURI(Uri

Video Frame by Frame seeking

帅比萌擦擦* 提交于 2019-12-03 08:33:43
Is there a way to step through a video file frame by frame? I've tried using a VideoView and I've had minor success. I can get the video the step through key frames but not individual frames. I figured this would be the default settings, especially with the way video compression works. Is there a way to override this default behavior or a configuration I can change? The default behaviour in stagefright media framework is always to seek to key frame. (As opposed to the earlier framework's - opencore whose default seeking behaviour was to seek to time.) You cannot do frame by frame seeking by

What is the differnce between accessing file from assets folder or SD card

北战南征 提交于 2019-12-03 08:06:36
I am developing an application where I have to use three different size's file (1mb, 5mb, 15mb). I searched, then came to know that we can keep these video in assets folder and can use those video. Secondly, I came to know that we can keep these videos in assets folder and installation time we can move all videos to SD card. when tried second approach faced problem due to bigger file size. So, can anyone please tell me what is difference between both approaches and which one I should use. Any pointer will be appreciated. Files over 1mb placed in the assets folder won't be readable from your

How to add video playback and resource to android application

和自甴很熟 提交于 2019-12-03 07:31:54
I have got problem with my idea on andriod app. I'd like to play video in it, but I don't want to download it from interenet. In other case, I want to have it on device. So, person is download it from android market and can play video without downloading it. I have came up with some solutions for it but none is good. First one was adding it to application resources, but you can't have video in there. Second one was adding or better creating folder during install (more specyfic first onCreate method) and then copying there video from app. Well, not so bad option (you can for example download

Best way to play a Video file?

南笙酒味 提交于 2019-12-02 00:47:22
问题 I have a URL for a video file which I need to play using the native Video-player of the handset. I figured using Intent.ACTION_VIEW and setting the URI as Intent data, I am able to achieve the aforementioned on G1 except HTC hero. In case of Hero, I have to explicitly set the class Name in the Intent to start the default Video Player: intent.setClassName("com.htc.album","com.htc.album.ViewVideo"); However, I am not comfortable with this approach as it might break on other Android devices.

setOnSeekCompleteListener for VideoView how can be achieved [duplicate]

我怕爱的太早我们不能终老 提交于 2019-12-01 23:06:43
问题 This question already has answers here : android: onSeekCompleteListener with VideoView (3 answers) Closed 8 months ago . I'm developing a video player application for which the user has an option to seek to a particular location, but the problem is there is no setOnSeekCompleteListener for VideoView, So I am not sure if the seek operation that was requested has completed or not, and whether to start playback if it is complete. Is there a way to implement a setOnSeekCompleteListener with

Best way to play a Video file?

跟風遠走 提交于 2019-12-01 21:37:54
I have a URL for a video file which I need to play using the native Video-player of the handset. I figured using Intent.ACTION_VIEW and setting the URI as Intent data, I am able to achieve the aforementioned on G1 except HTC hero. In case of Hero, I have to explicitly set the class Name in the Intent to start the default Video Player: intent.setClassName("com.htc.album","com.htc.album.ViewVideo"); However, I am not comfortable with this approach as it might break on other Android devices. Please advice on : 1. What would be the best way to play this video url via Intent, irrespective of the

setOnSeekCompleteListener for VideoView how can be achieved [duplicate]

痞子三分冷 提交于 2019-12-01 21:00:48
This question already has an answer here: android: onSeekCompleteListener with VideoView 3 answers I'm developing a video player application for which the user has an option to seek to a particular location, but the problem is there is no setOnSeekCompleteListener for VideoView, So I am not sure if the seek operation that was requested has completed or not, and whether to start playback if it is complete. Is there a way to implement a setOnSeekCompleteListener with VideoView. Thanks, Shrikant. You can switch from using VideoView to using MediaPlayer and a SurfaceView . Or, grab the source code

How to play Live Streaming video in Android

别等时光非礼了梦想. 提交于 2019-12-01 08:16:14
In my project I have a requirement to play live streaming video. I have seen many comments that "live streaming is supported only from 3.0" so that I have to use emulator 3.0. But it does not play. Can anybody help for me.. This is my code: String SrcPath="http://akamedia2.lsops.net/live/smil:cnbc_en.smil/playlist.m3u8"; myVideoView = new VideoView(this); myVideoView.setVideoURI(Uri.parse(SrcPath)); setContentView(myVideoView); myVideoView.setMediaController(new MediaController(this)); myVideoView.requestFocus(); myVideoView.setOnErrorListener(new OnErrorListener() { public boolean onError