android-videoview

Play a youtube url in android

帅比萌擦擦* 提交于 2019-12-02 07:51:13
问题 I have a fragment and a videoview is present inside that fragment.I have a you tube url for video. I tried videoview as well as webview. But it is not working. How i should play that video inside that layout? 回答1: Just use normal a webview and everything will be fine. Try this : ( Tested and works ) new Thread(new Runnable() { @Override public void run() { final WebView myWebView = (WebView) findViewById(R.id.webView1); myWebView.setWebViewClient(new WebViewClient()); myWebView.getSettings()

First Back button press not caught when playing a video android

匆匆过客 提交于 2019-12-02 07:12:47
I have a weird error that I cant figure out how to fix . I have a video player - a simple videoview that plays a video. Now I ve implemented logic so that when the user presses the back button - it tells him to press the back button again to exit, and when he does it exits. But the problem is the first back press is not caught! I dont know what is causing this. I Press back once nothing happens, I press again and it shows me the toast that says "Please press back again to exit" and on pressing again it exits. The first one is not caught no matter what I do . This is the code for OnBackPressed(

VideoView in eclipse not playing on phone

岁酱吖の 提交于 2019-12-02 04:21:19
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); MediaController mediaController = new MediaController (this); mediaController.setAnchorView(videoView); Uri video

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

北城以北 提交于 2019-12-02 04:20:31
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? Abhi Try this. It worked for me. void playvideo(String url) { String link=url; Log.e("url",link); view1 = (VideoView) findViewById(R.id.myVideoView);

android: hiding media controller functions

廉价感情. 提交于 2019-12-02 02:34:34
问题 I have a videoview and when the video starts, the media controller is shown for 3 seconds. I want to hide the media controller unless i tap on the screen. I tried MediaController mc= new MediaController(); mc.hide(); Videoview.setMediaController(mc); .. .. .. But it didn't work.. Any suggestions please? 回答1: This isn't really a solution to hiding the MediaController, but if you want to get rid of the thing altogether, do this: videoView.setMediaController(null); You can have it initially

Can't run live stream using Vitamio

老子叫甜甜 提交于 2019-12-02 02:11:18
I'm trying to use Vitamio to run RTSP video stream, I'm using Vitamio-sample after updating it to run the stream through VideoViewDemo activity: public class VideoViewDemo extends Activity { /** * TODO: Set the path variable to a streaming video URL or a local media file * path. */ private String path = "rtsp://user:password@<stream-ip>:554"; private VideoView mVideoView; private EditText mEditText; @Override public void onCreate(Bundle icicle) { super.onCreate(icicle); if (!LibsChecker.checkVitamioLibs(this)) return; setContentView(R.layout.videoview); mEditText = (EditText) findViewById(R.id

android: hiding media controller functions

匆匆过客 提交于 2019-12-02 00:49:25
I have a videoview and when the video starts, the media controller is shown for 3 seconds. I want to hide the media controller unless i tap on the screen. I tried MediaController mc= new MediaController(); mc.hide(); Videoview.setMediaController(mc); .. .. .. But it didn't work.. Any suggestions please? This isn't really a solution to hiding the MediaController, but if you want to get rid of the thing altogether, do this: videoView.setMediaController(null); You can have it initially hidden by doing the above, and then when you want it to show (onClick or onTouch or whatever), just make a new

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

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

MediaMetadataRetrieverJNI(14060): getFrameAtTime: videoFrame is a NULL pointer(Android)

懵懂的女人 提交于 2019-12-01 19:18:27
I am creating thumbnails by videos frame using MediaMetadataRetriever but I am getting this message in Logcat : E/MediaMetadataRetrieverJNI(14060): getFrameAtTime: videoFrame is a NULL pointer Here is my code: MediaMetadataRetriever retriever = new MediaMetadataRetriever(); try { Uri videoURI = Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.video_one); retriever = new MediaMetadataRetriever(); retriever.setDataSource(mContext, videoURI); Bitmap bitmap = retriever.getFrameAtTime(100000,MediaMetadataRetriever.OPTION_CLOSEST_SYNC ); Drawable drawable = new BitmapDrawable(getResources(