android-video-player

stream live video to Android

不打扰是莪最后的温柔 提交于 2019-11-28 04:11:34
How can I stream live video to Android (2.1 and higher), I have two links: m3u8 and f4m (As I know, f4m is not supported). From what I saw on stackoverflow, there is a way to stream m3u8 with vitamio (but the link is not working ). Is there any other way to stream m3u8 video ? Maybe there is other format that I can use ? Thanks. Butters Because no one answered my question, I will do it myself. If you want to perform HLT (HTTP Live Stream) on Android 2.1 and higher you may use the vitamio library. Site at: ( http://www.vitamio.org/ ). Here is code example: The main layout: <?xml version="1.0"

VideoView inside fragment causes black screen flicking

走远了吗. 提交于 2019-11-27 14:37:32
We have an Android application running on Android API 4.0. One of the activities has a layout that divides the screen in 2 parts. On the left side we have a static part with some buttons. On the right side we have a FrameLayout that will switch to the corresponding fragment depending on the button that is pressed. Problem: One of the fragments on the right side contains a VideoView. When the user clicks on the button to show this fragment the fragment is shown and the video immediately starts playing however: upon rendering this fragment the complete screen flickers in black which is very

Resize video to fit the VideoView

走远了吗. 提交于 2019-11-27 10:57:58
问题 I'm positioning a VideoView with AbsoluteLayout (I need to display it on several places into the screen at specific positions). public void showVideo(RectF bounds, final String videoUrl) { AbsoluteLayout.LayoutParams params = (AbsoluteLayout.LayoutParams) video.getLayoutParams(); params.width = (int) bounds.width(); params.height = (int) bounds.height(); params.x = (int) bounds.left; params.y = (int) bounds.top; video.requestLayout(); video.setVisibility(View.VISIBLE); video.setFocusable(true

How to create a video preview in android?

只愿长相守 提交于 2019-11-27 10:57:31
问题 I have a video file in my sdcard. I would like to show a preview of this video in my ImageView . Please let me know how to do this in Android. Thank you for your help and time. 回答1: If you use API level 8 and above. You can create preview of a video like this: String videoFile = "/sdcard/blonde.mp4"; Bitmap thumbnail = ThumbnailUtils.createVideoThumbnail(videoFile, MediaStore.Images.Thumbnails.MINI_KIND); Now you can show it in an ImageView : ImageView imageView = (ImageView) findViewById(R

VideoView onResume loses buffered portion of the video

余生长醉 提交于 2019-11-27 06:54:10
I am having an Activity in which there is VideoView -- Streams a video from a webserver. Button -- Takes the user to the next activity to be shown. When the application starts, VideoView is made to play the Video from a webserver. Now assume Total Video length is 60 Minutes Current Video progress is 20 Minutes Current Buffered progress 30 Minutes Now when I click on the above mentioned Button which takes user to the next activity. From that Activity if i press the back button, Previous Activity(with VideoView and Button) appears in front of the user. But when resumed all the Buffered Portion

how to create custom UI for android MediaController

感情迁移 提交于 2019-11-26 17:01:55
I want to customize the controls in the MediaController for my video player. I want to swap out the image for the play button, change the skin, change the color, ect. Is there a known way of doing this? Thanks I had the same problem on a recent project and ended up creating a custom implementation based on the stock MediaController. It adds a fullscreen button at the far right, but even if that's not what you want this class should be a good starting point. Code: VideoControllerView.java - http://pastebin.com/1V63aVSg media_controller.xml - http://pastebin.com/rS4xqMej Image resources: Gotchas

VideoView inside fragment causes black screen flicking

梦想与她 提交于 2019-11-26 16:53:06
问题 We have an Android application running on Android API 4.0. One of the activities has a layout that divides the screen in 2 parts. On the left side we have a static part with some buttons. On the right side we have a FrameLayout that will switch to the corresponding fragment depending on the button that is pressed. Problem: One of the fragments on the right side contains a VideoView. When the user clicks on the button to show this fragment the fragment is shown and the video immediately starts

Is it possible to Generate a thumbnail from a video url in android

允我心安 提交于 2019-11-26 15:22:10
I am working on a video app. I am streaming a video from server link , is it possible for me to generate a video thumbnail from the URL without downloading the video. KishuDroid Without downloading video you can generate thumbnail from below code: public static Bitmap retriveVideoFrameFromVideo(String videoPath) throws Throwable { Bitmap bitmap = null; MediaMetadataRetriever mediaMetadataRetriever = null; try { mediaMetadataRetriever = new MediaMetadataRetriever(); if (Build.VERSION.SDK_INT >= 14) mediaMetadataRetriever.setDataSource(videoPath, new HashMap<String, String>()); else

VideoView onResume loses buffered portion of the video

允我心安 提交于 2019-11-26 12:14:08
问题 I am having an Activity in which there is VideoView -- Streams a video from a webserver. Button -- Takes the user to the next activity to be shown. When the application starts, VideoView is made to play the Video from a webserver. Now assume Total Video length is 60 Minutes Current Video progress is 20 Minutes Current Buffered progress 30 Minutes Now when I click on the above mentioned Button which takes user to the next activity. From that Activity if i press the back button, Previous

how to create custom UI for android MediaController

筅森魡賤 提交于 2019-11-26 04:59:39
问题 I want to customize the controls in the MediaController for my video player. I want to swap out the image for the play button, change the skin, change the color, ect. Is there a known way of doing this? Thanks 回答1: I had the same problem on a recent project and ended up creating a custom implementation based on the stock MediaController. It adds a fullscreen button at the far right, but even if that's not what you want this class should be a good starting point. Code: VideoControllerView.java