android-videoview

Android get Video source path from VideoView

倖福魔咒の 提交于 2019-12-05 06:39:52
I have VideoView instance. I need to know video source path from it. Is it possible? Can anybody help me? My code from WebChromeClient class is: @Override public void onShowCustomView(final View view, final CustomViewCallback callback) { super.onShowCustomView(view, callback); if (view instanceof FrameLayout) { final FrameLayout frame = (FrameLayout) view; if (frame.getFocusedChild() instanceof VideoView) { // get video view video = (VideoView) frame.getFocusedChild(); } } } How to get video source path fron video object ? VideoView doesn't have getters for video path/Uri. Your only chance is

How to perform zoom in/out on VideoView in android?

允我心安 提交于 2019-12-05 06:33:18
I am using VideoView & running videos from resources. I want to know, is there any way by which I can perform zoom in/out functionality on running video? OK I had this issue and solved it by removing the VideoView and replaced it with a TextureView . You can then apply a Matrix transformation which includes lots of options including zooming. The method for the Matrix I would use is the postScale() method. You can apply multiple effects pre and post, which you can view in the documentation. Edit Here is a custom VideoView from a running project that we used. You can decalre it in XML Layouts

Android - Different ways of playing video

故事扮演 提交于 2019-12-05 04:21:14
问题 I just came across the limitation of VideoView of not being able to play mp4 video files that are wider than 320 pixels. I was wondering how can we overcome these limitations. I am trying to make my app as forgiving as possible, so other than using VideoViews is there another way to play these mp4 videos? Chris 回答1: I am not aware of a 320px wide limit on VideoView , though I haven't tried it. You can use MediaPlayer and a SurfaceView to play back videos. In fact, that's pretty much all

How to detect when VideoView starts playing (Android)?

て烟熏妆下的殇ゞ 提交于 2019-12-05 03:38:35
Here's the problem, I want to change play button to pause button when the video stream starts playing in videoview but I don't know how to detect that event? There is a great article about MediaPlayer in here - http://www.malmstein.com/blog/2014/08/09/how-to-use-a-textureview-to-display-a-video-with-custom-media-player-controls/ You can set infoListener on your VideoView setOnInfoListener(new MediaPlayer.OnInfoListener() { @Override public boolean onInfo(MediaPlayer mp, int what, int extra) { if (what == MediaPlayer.MEDIA_INFO_VIDEO_RENDERING_START) { // Here the video starts return true; }

Android portrait video orientation wrong in VideoView

喜夏-厌秋 提交于 2019-12-05 02:41:17
I capture a new video in PORTRAIT orientation on an Android device like this: Intent intent = new Intent(android.provider.MediaStore.ACTION_VIDEO_CAPTURE); startActivityForResult(intent, 1886); and it gives me this file: "/mnt/sdcard/DCIM/Camera/video-2012-02-02-10-45-48.mp4" Then I play it like this: private VideoView videoView = (VideoView) findViewById(R.id.videoView); String videoUrl = "/mnt/sdcard/DCIM/Camera/video-2012-02-02-10-45-48.mp4"; videoView.setMediaController(new MediaController(this)); videoView.setVideoURI(Uri.parse(videoUrl)); videoView.start(); Here's my layout file: <?xml

How do i get thumbnail of a video in android

和自甴很熟 提交于 2019-12-04 23:24:43
i want some help in creating thumbnail of a video being recorded from my android phone and i have get this code from this Link , and i modified this part of the code to generate the thumbnail but somehow the thumbnail is not being generated , so any help will be appreciated. @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (resultCode == RESULT_OK && requestCode == VIDEO_CAPTURED) { videoFileUri = data.getData(); if (videoFileUri != null) { Bitmap image= ThumbnailUtils.createVideoThumbnail

Navigation Drawer and VideoView in android

人盡茶涼 提交于 2019-12-04 22:45:39
I am using a navigation drawer plus a tablayout. I have a video in my tab which was not visible at first, but I can hear the sound. Once I set video_view.setZOrderOnTop(true); and I can also see the video, but this causes an issue with navigation drawer. When I slide it, the video doesn't hide behind the navigation drawer as do all other elements. If I don't use video_view.setZOrderOnTop(true); then my drawer is works fine. main_activity.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/drawer_layout" android:layout_width=

How to display video in VideoView in the center of the screen?

自闭症网瘾萝莉.ら 提交于 2019-12-04 20:11:30
I am creating ViewPager with two VideoViews . On sliding pages, video on current page start playing. One problem: how to display video in VideoView in the center of the screen ? Here is my code, MainActivity.java: public class MainActivity extends Activity{ private class MyViewPagerAdapter extends PagerAdapter implements ViewPager.OnPageChangeListener { private Vector<View> pages; private ViewGroup myContainer; private int currentPageId; private boolean flag; public MyViewPagerAdapter(Context context, Vector<View> pages) { this.pages=pages; } @Override public int getCount() { return pages.size

RTSP stream in android with username and password

眉间皱痕 提交于 2019-12-04 19:51:08
My task is to create an android application in android to check some IP cameras of the city. Using the existing RTSP url which is rtsp://admin:pms7112@xxx.xx.xx.xxx:554/cam/realmonitor?channel=1&subtype=0 I can get the stream in VLC player but no luck in android. I have tried videoview native player and media player . Almost every solution gave me MediaPlayer: setDataSource IOException happend : java.io.FileNotFoundException: No content provider: rtsp://... Should this problem happen because the username and password is in the string ? how could you add the username and password as query

Android Video Player libraries with cache video

为君一笑 提交于 2019-12-04 18:58:12
问题 I developed android app which is based on video listing,I face some problems that are, 1.When scroll a listview video need auto play 2.Need pause,stop,resume and full screen mode 3.Every time video is streaming 4.How to make cache videos and play without stream Is there any Lib or reference link,and advance Thanks 回答1: i suggest ExoPlayer, here is a good sample for caching, you can use VideoCache or OkHttpDataSource 来源: https://stackoverflow.com/questions/41585763/android-video-player