Reputation: 53
I am Building An app for on line streaming,using MediaPayer to stream videos,
player.setDataSource(this, Uri.parse(getLink()));
but his seems rather slow ,is there more efficient way to stream videos ,please guide thanx in advance
Upvotes: 0
Views: 121
Reputation: 2763
is there more efficient way to stream videos ?
You could try using the VideoView
class:
https://developer.android.com/reference/android/widget/VideoView.html
Displays a video file. The VideoView class can load images from various sources (such as resources or content providers), takes care of computing its measurement from the video so that it can be used in any layout manager, and provides various display options such as scaling and tinting.
or if you are willing to write some boiler plate code (mostly using dependency injection) you could try ExoPlayer
.
https://developer.android.com/guide/topics/media/exoplayer.html
There is some excellent sample code in GitHub for ExoPlayer as well to get you started.
Upvotes: 1