1

I am going to create InApp Video player which will play the videos from our content server and will also support live streaming. Previously was using third party API. I am confused about going with SurfaceView or VideoView as I have read that VideoView has more lines of code and will be less efficient. Help needed regarding from where should I start? Also need clarity between both. Yes, I have gone through some questions but still confused. Thank you in Advance.

Adnan khalil
  • 134
  • 1
  • 9

1 Answers1

4

Frankly Speaking,

VideoView is the combination of SurfaceView and MediaPlayer,

VideoView = SurfaceView + MediaPlayer

But advantage of using Surfaceview and MediaPlayer separately is that you will have the ability to customize it.

I just used VideoView few days ago in my app. I actually had the same confusion. Since, then I came to know about it. I used VideoView. Here is the link below

Link

Hope it helps

Ümañg ßürmån
  • 9,695
  • 4
  • 24
  • 41
  • So, If I need to have a custom layout/View for video playing controls what should I use? And how about the callbacks for both VideoView and SurfaceView? – Adnan khalil Aug 29 '18 at 12:21
  • @adnankhalil In my project which played videos from the web as well as from the memory card, I used video view and it's very easy to implement and use. Callbacks are available for VideoView in-built. On the other hand, If you consider SurfaceView, that is just a view to display, your video will not play on it until you add a MediaPlayer class to it. Both VV and SV will give you the same functionality. The only difference is you can customize SV however you wish to but VV has built in controls, you have to use those for Video Playback. – Ümañg ßürmån Aug 29 '18 at 12:40
  • Thank you for clarification. – Adnan khalil Aug 29 '18 at 13:43
  • You're very welcome... And if you consider my opinion, then use VV to avoid extra coding and save Development time.. – Ümañg ßürmån Aug 29 '18 at 15:08