I wanted to build an application that will allow user to share comments about any video while they watch them. For that I require a View over the Media Player view.
Can anyone please guide me how we can achieve this?
You can have a FrameLayout or a RelativeLayout and stack the View you want over the MediaPlayer View.
Hope this helps!
Related
On Video players such as Youtube, I often see that when the user taps on the video view a sort of overlay shows up where the user can choose actions like: “share”, “add to playlist”, “pause”, etc. Basically it’s whatever the developer wants. The developer seems to be able to choose what the icons are, where they go, etc.
I would like to know how it’s done. For example, are they using a VideoView with an overlay? Are they using a FrameLayout with a VideoView and a RelativeLayout on top of the VideoView? I just need some advice in the right direction as I don’t know where to start. Thanks. For simplicity, I am looking to add a Youtube style video player to my activity. And by Youtube style, I am referring to the aforementioned interactions.
I would like to know how it’s done
I am sure that the implementation varies widely.
For example, are they using a VideoView with an overlay?
AFAIK, few professional-grade apps use VideoView, simply because VideoView offers little in the way of events or control. More likely, they are using something else backed by MediaPlayer or third-party media libraries (e.g., ExoPlayer).
Are they using a FrameLayout with a VideoView and a RelativeLayout on top of the VideoView?
No, because that would be two VideoView widgets. However, whatever their video surface is probably resides in a RelativeLayout or FrameLayout, with the overlay as another child of that same container, though I am sure that there are other approaches.
You are welcome to use uiautomatorviewer to try to learn more about the view hierarchy of particular apps of interest.
Hi I am developing small android application in which I want to display some textual information over my video view same like youtube showing text content over the video and user can close that content.I am bit confuse to decide which approach I should take. Either use surfaceview or user video view Or user some custom video view with extended class. Ot just include text view with overlay on top of video view. Any one here already implemented this king of stuff can please help me to sort this situation. Need some help. Thank you.
I am trying to play videos in my listview just like Vine or Instgram. I have been trying to use TextureView with a media player except that when attaching TextureView to the media player I experience issues where the textureview is not being reused properly by the GetView method. The textureview renders some old incorrect videos when scrolling down in my list.
Does anyone know how to play videos in ListViews (Not using VideoView!!!)??
Just wanna give you advice.
You can use WebView inside listview item and using javascript to play the video. you can find the javascript play on html
http://www.w3schools.com/tags/av_prop_autoplay.asp
I hope my advice may help you something out.
Found the solution to this problem. I need to use TexutreView with MediaPlayer, and I need to dynamically add the TextureView to each item in the list. I also need to make sure that I remove any previous TexutreViews that was previously attached to the item in the list before adding a new one dynamically. Also, I need to make sure that I only play one MediaPlayer at a time in the listview to avoid causing any strange behaviors (i.e. videos can play in the wrong position).
You really need to use TextureView. There is actually few problems you need to solve.
Please find expanded answer here:
Run media file in CardView layout
I have been Created the app which contains default android media player with surfaceView. I can resize the Video , but not able to resize the media player for modify the height and with of play/pause button. In that I having 2 doubt.
Whether can I inflate any custom layout to replace that default media player.
Is it possible to convert MediaController to View or ViewGroup .
or else, Is there any possibility to setLayoutParams() for mediaController in code not in xml?
Any have an idea?
Please help me!.
Thanks in advance.
Regards,
ThiloG.
You can use your layout that will represent play, stop and pause (for instance) buttons. You just put it on your layout on the bottom. I didn't understand you very well, but this will do the work...
I have been searching around for any info on creating a video player. Here is what I am looking for, I want to create a player to play videos (stream preferably) with my own custom playback buttons. The player will be set in a View (size of the view varies). Can i do this with just the MediaPlayer class, and can i add it in a View. If there are any examples or tutorials. I would greatly appreciate it. Thankx again in advance
the most straight forward way of controlling a video is using the mediaController class:
http://developer.android.com/reference/android/widget/MediaController.html
This can ether be anchored to a mediaPlayer or a VideoView. Both of these support streaming and since mediaController is a Widget it can be customized.
This should be enough unless you looking to do something really out there with the controller.
Hope this helps