My video datasource is 1920*1080, and my textureView is 622px * 540px. and I only want to display part of the video in the TextureView. How to do this? please help me , thanks.
I have solved it, i want it. https://github.com/dmytrodanylyk/video-crop/blob/master/library/src/com/dd/crop/TextureVideoView.java
Related
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
i am using SurfaceView for play video and i want to get image from running video, i have tried with getDrawingCache() but i am getting blank image or Black screen but when i draw image of any other layout which dont have video then this is working fine,
so please anybody can solve this issue that How to get bitmap images from video or surfaceView. Thanks in advance please answer my question if you know.
I have used this code but not getting result.
mVideo.setDrawingCacheEnabled(true);
mVideo.buildDrawingCache();
Bitmap b = mVideo.getDrawingCache();
This won't work because the video content is not "exposed" to the normal view layers.
If you are using API Level >= 10 you can use MediaMetadataRetriever getFrameAtTime. It's described here.
Even this may not return the exact frame as it is fairly hardware dependent.
The most sure way to do this is to use something like FFMPEG to access the stream yourself.
It can be easily view the doted rectangle over the video, so, please suggest how to get rid of these issue.. thank you for your concern
I'm trying to get a snapshot of the current position of playback of a video, but I couldn't find an appropriate way to do that. Is there a method I can use?
Any help would be appreciated.
Thanks.
VideoView extends SurfaceView, so it seems there is no easy way to do it. Take a look at this post: http://groups.google.com/group/android-platform/browse_thread/thread/c4720072d659f4f0/9b207dc411c5e800?lnk=raot
You may need to read the movie raw file, implement your own drawing mechanism, and access directly the file instead of the Canvas for the screenshot.
I want to play a video giving fixed height and width, not whole screen.
Can anybody tell me how to play the video in a surface view on android? Please provide sample code
Thanks
Maybe a VideoView is what you want. I found some sample-code here.
Please try below:
surfaceholder.setFixedSize(width,height);