mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-05 16:22:53 +00:00
Bug 1373377 - Remove the 'url must contain .m3u8' constrain. r=kikuo
MozReview-Commit-ID: GN7YefuNY9w --HG-- extra : rebase_source : 8793e438429ca8521ee3542569797ac1687bace1
This commit is contained in:
parent
efd723cdad
commit
4de4243edc
@ -254,20 +254,6 @@ public class GeckoHlsPlayer implements BaseHlsPlayer, ExoPlayer.EventListener {
|
||||
return new DefaultHttpDataSourceFactory(AppConstants.USER_AGENT_FENNEC_MOBILE, bandwidthMeter);
|
||||
}
|
||||
|
||||
private MediaSource buildMediaSource(Uri uri, String overrideExtension) {
|
||||
if (DEBUG) { Log.d(LOGTAG, "buildMediaSource uri[" + uri + "]" + ", overridedExt[" + overrideExtension + "]"); }
|
||||
int type = Util.inferContentType(TextUtils.isEmpty(overrideExtension)
|
||||
? uri.getLastPathSegment()
|
||||
: "." + overrideExtension);
|
||||
switch (type) {
|
||||
case C.TYPE_HLS:
|
||||
return new HlsMediaSource(uri, mMediaDataSourceFactory, mMainHandler, null);
|
||||
default:
|
||||
mResourceCallbacks.onError(ResourceError.UNSUPPORTED.code());
|
||||
throw new IllegalArgumentException("Unsupported type: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
// To make sure that each player has a unique id, GeckoHlsPlayer should be
|
||||
// created only from synchronized APIs in GeckoPlayerFactory.
|
||||
public GeckoHlsPlayer() {
|
||||
@ -541,7 +527,11 @@ public class GeckoHlsPlayer implements BaseHlsPlayer, ExoPlayer.EventListener {
|
||||
|
||||
Uri uri = Uri.parse(url);
|
||||
mMediaDataSourceFactory = buildDataSourceFactory(ctx, BANDWIDTH_METER);
|
||||
mMediaSource = buildMediaSource(uri, null);
|
||||
mMediaSource = new HlsMediaSource(uri, mMediaDataSourceFactory, mMainHandler, null);
|
||||
if (DEBUG) {
|
||||
Log.d(LOGTAG, "Uri is " + uri +
|
||||
", ContentType is " + Util.inferContentType(uri.getLastPathSegment()));
|
||||
}
|
||||
|
||||
mPlayer.prepare(mMediaSource);
|
||||
mIsPlayerInitDone = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user