nullByte
nullByte

Reputation: 53

what is the most efficient way to stream videos in android app

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

Answers (1)

user1841702
user1841702

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

Related Questions