Videoview Resize Not Working while using DraggablePanel Library Android - android

I am trying to implement drag layout like youtube, for playing video in my applicaiton.
I took the help from DraggablePanel library in Github. It works fine.
My application is for above 4.0 .
When i try to drag the video it do not scale properly. Video is getting cut, when dragged/minimized to bottom.
Can you please help me how to resize the video when dragged ?

Solved it myself. User TextureView instead of SurfaceView or VideoView. SurfaceView does not support animations. Check this link if you want to know how to use textureView for playing video : Playing video on TextureView

Related

How to flip(mirror effect) a video in a VideoView?

I know there are ways using TextureViews and some other ways, but can we do a video flip in a VideoView, I tried using the method scaleType of X axis to -1, but just getting a black screen. Is there no way to do a simple video flip for a video being played in a videoview? Am I forced to use a TextureView or other methods?
As you said, the best option is to use TextureView... Android's VideoView can only play videos straight and not mirrored.
If you want your app to play a video mirrored (for instance if the video was recorded using a front camera), you will need to use a TextureView, which can be easily mirrored by specifying android:scaleX=-1 in the XML file, or textureView.setScaleX(-1) in the code. (source)

No video, only sound with VideoView

When I play a video file using a VideoView on Android, I can hear the sound fine, but the video does not show.
So, when I use :
myVideoView.setZOrderOnTop(true);
then the video shows fine, however, then my TextView is behind the VideoView and I need it to be in front.
Therefore, I either need a solution so that the video is played without using setZOrderOnTop, or I need a way to get the text in front of the video while using setZOrderOnTop.
videoView.setBackgroundColor(Color.TRANSPARENT);

How to hide video in a surfaceview and keep audio playing

I am using a mediaplayer on surfaceview and playing a video file. I dont want the video to be displayed but audio must be audible. Seen some of the questions and tried them, no help. Somebody please help.
Use a RelativeLayout and put an ImageView (with match_parent for width and height) above the SurfaceView in your layout. Set the source for the ImageView to a thumbnail and let the video play behind it (but not visible to the user).

VideoView: Fullscreen on doubleTap

Basically, what I want to do in my application is displaying a video.
The best tool to achieve this goal seem to be a VideoView.
So I used this code:
<VideoView android:id="#+id/videoview" android:layout_width="50dip" android:layout_height="50dip"></VideoView>
and in my Activity:
VideoView videoHolder = (VideoView)findViewById(R.id.videoview);
videoHolder.setMediaController(new MediaController(this));
videoHolder.setVideoURI(Uri.parse("android.resource://com.blabla.blabla/" + R.raw.blabla));
videoHolder.requestFocus();
videoHolder.start();
and that do the trick.
Unfortunately, I was expecting having a preview (thumbnail) of the video in my layout by default
So , I removed the videoHolder.start(); command, but I can only get a blackscreen. The video start when tapping on an invisible zone...
First question
Is that possible to display a preview of the video in the VideoView before starting it?
Second question
I wuld like to display the video on Fullscreen when double tapping the webview, How can I achieve this?
Thank a lot for any help / link / suggestion
Yes, you can get video thumbnails using ThumbnailUtils:
Bitmap thumb = ThumbnailUtils.createVideoThumbnail(path,
MediaStore.Images.Thumbnails.MINI_KIND);
I haven't really seen apps toggle into fullscreen before. I'm actually not sure if it can be done (especially for a VideoView). However, you might have some luck with one of these methods:
Holding the VideoView in a FrameLayout and then changing its layout parameters.
Overlaying the VideoView via Window#addContentView.
Hiding (via Visibility.GONE) your other views and allowing the VideoView to expand its layout area.
You can use VideoView.seekTo(milliseconds) as an alternative, let say 1 second (1000 milliseconds). Provided that the video clip after 1 second does have an image, like some videos starts from blank screen then "fade-in" (lack of better word) to a scene would more often gives you a black screen with 1 second. You can call this under VideoView.onPrepared(). This one i use when the video is on a web server.

Android playing video with the camera surfaceview in background

Hello
i have a surfaceview and a videview in a framlayout. if i start the video in oncreate, i see all perfectly, the video playing while the camera plays in background.
but if i start the video after oncreate, for example in onpreviewframe, i can only hear the video, but it's like behind the camera, and all i see is the camera view.
any help?
You Need to Merge both layouts... see the Example.

Categories

Resources