I have a viewpager which has two views in it. On the first view I have a list of videos and on the other one I play the video.
The issue is when I play the video on the second view and if I want to go back to the first view, there is a black rectangle remaining from the video. it disappears after a few seconds.
I am using a galaxy note running ICS.
Can it be because of memory usage?
Thanks,
I solved this problem long time ago by setting background color of the videoview to some color and then making it '0' onVideoPrepared().
Well, do you "stop()" the video when you start dragging the page ?
if not, then you need to add a OnPageChangeListener to the viewpager, so when you start scrolling/dragging the page, you stop the videoview, that should fix your problem,
the more probable thing is that for optimization reasons does not want to be playing the video as dragging the page so puts a "picture" of the video while moving.
Related
I'm developing a social media app which has feed tab based on RecyclerView. On that feed tab I have many types of feedtype like text, photo, photo and text, book, etc... So till now I didn't had any problem about this. On my view holder I've Middle Item Container Panel. I'm putting template which is coming from my feedtypemanager class. So now I need to add videoview for my video feeds. First problem is I'm using rtsp server for streaming. VideoView starting after 15 seconds from seeing that view. Second one is when I scroll down and come up again my VideoView starting from beginnging and I'm waiting 15 seconds again to play that video. So how can I do that view like Instagram fast ? Which protocol I should use and Which VideoPlayer ? Thanks for help.
I've faced the same issues with videoview,
I would recommend to use Exomedia library and make your life easy with that.
For smooth video playback use some caching mechanism.
I would recommend AndroidVideoCache Library.
Use app:useTextureViewBacking="true" for smooth animations and transitions of videoview.
I have an app that I'm working where in one activity I'm using a VideoView while setting the theme for that activity translucent (transparent) : android:theme="#android:style/Theme.Translucent.NoTitleBar.Fullscreen"
However I'm noticing odd behavior from the videoView - for a split second before the video starts playing (it's auto play) the frame where the videoView is itself transparent and you can see the activity behind it. For reference the activity in question has other elements to it and the video is framed.
Is there anyway to make this black or even a custom image that covers the frame before the video starts?
videoView.setBackgroundColor is buggy and actually changes the foreground color and keeps the frame that color while playing...
thanks for your time!
videoView.setZOrderOnTop(true);
SurfaceView (and VideoView as subclass) is placed behind the window by default. So you should call: videoView.setZOrderOnTop(true) if you want to place it on top (to make it non transparent).
You can cover the ViewView with another View and then as soon as video playing starts you can animate this View out, let's say quickly changing its alpha to 0.0.
Please read this response in other SO thread, i think it's the solution for this problem, at least it worked for me
My application has several pages of book. In some of page I am playing video using video view. I am checking if I have any video for that page. If yes, than I am making videoview visible and passing Uri. If not, I am making it gone.
Now the problem is, once i reached to that screen and then if I swipe left/right it's creating black window in every subsequent screen. Why?
I found solution. When you want to show video make videoView.setZOrderOnTop(false); and when you want to hide video view jusr make videoView.setZOrderOnTop(true);
Here is what I have to do:
I want to create a widget which plays a short video clip. So, what I did is, to do screenshots of the movies and get a series of screenshots of it and switch the image in a certain frame rate to achieve what I want.
In here, I used ViewFlipper and a number of ImageView under it. But the problem comes.
I have no idea how to set ViewFlipper to flip through all the ImageView once and stop at the last one. I tried to set it as AutoStart true and set it back to false after a certain time (using Handler) but it doesnt work.
can anyone help?
Have you tried calling stopFlipping() on view flipper?
I have a webview that's playing a video, and I want it to appear behind some other views, but I can't seem to make it happen. I've tried simply just sending the foreground views to the front with bringChildToFront(View v), but no cigar. Any thoughts?
Edit: Some more details: The webview plays a video using flash, and the webview is the size of the entire screen. I have some stuff I want to pop up in front of the video, but they only stay behind the video. They're definitely there, as they receive touch events and stuff, but just hidden away from view by the video.
Since the Flash player will essentially pre-empt any other views in the window, you'll just have to do one better over Flash: use another window on top of the main window.
Android allows you to do this by using the PopupWindow class.