Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/video_player/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.10.2+4

* Updated ExoPlayer to version 2.10.5

## 0.10.2+3

* Fix bug where formatHint was not being pass down to network sources.
Expand Down
9 changes: 5 additions & 4 deletions packages/video_player/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ android {
}
}

def exoPlayerVersion = '2.10.5'
dependencies {
implementation 'com.google.android.exoplayer:exoplayer-core:2.9.6'
implementation 'com.google.android.exoplayer:exoplayer-hls:2.9.6'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.9.6'
implementation 'com.google.android.exoplayer:exoplayer-smoothstreaming:2.9.6'
implementation "com.google.android.exoplayer:exoplayer-core:$exoPlayerVersion"
implementation "com.google.android.exoplayer:exoplayer-hls:$exoPlayerVersion"
implementation "com.google.android.exoplayer:exoplayer-dash:$exoPlayerVersion"
implementation "com.google.android.exoplayer:exoplayer-smoothstreaming:$exoPlayerVersion"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import android.content.Context;
import android.net.Uri;
import android.os.Build;
import android.util.LongSparseArray;
import android.view.Surface;
import com.google.android.exoplayer2.C;
Expand All @@ -21,8 +20,8 @@
import com.google.android.exoplayer2.SimpleExoPlayer;
import com.google.android.exoplayer2.audio.AudioAttributes;
import com.google.android.exoplayer2.extractor.DefaultExtractorsFactory;
import com.google.android.exoplayer2.source.ExtractorMediaSource;
import com.google.android.exoplayer2.source.MediaSource;
import com.google.android.exoplayer2.source.ProgressiveMediaSource;
import com.google.android.exoplayer2.source.dash.DashMediaSource;
import com.google.android.exoplayer2.source.dash.DefaultDashChunkSource;
import com.google.android.exoplayer2.source.hls.HlsMediaSource;
Expand All @@ -40,9 +39,7 @@
import io.flutter.plugin.common.MethodChannel;
import io.flutter.plugin.common.MethodChannel.MethodCallHandler;
import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugin.common.PluginRegistry;
import io.flutter.plugin.common.PluginRegistry.Registrar;
import io.flutter.view.FlutterNativeView;
import io.flutter.view.TextureRegistry;
import java.util.Arrays;
import java.util.Collections;
Expand Down Expand Up @@ -150,8 +147,8 @@ private MediaSource buildMediaSource(
case C.TYPE_HLS:
return new HlsMediaSource.Factory(mediaDataSourceFactory).createMediaSource(uri);
case C.TYPE_OTHER:
return new ExtractorMediaSource.Factory(mediaDataSourceFactory)
.setExtractorsFactory(new DefaultExtractorsFactory())
return new ProgressiveMediaSource.Factory(
mediaDataSourceFactory, new DefaultExtractorsFactory())
.createMediaSource(uri);
default:
{
Expand Down Expand Up @@ -223,14 +220,9 @@ private void sendBufferingUpdate() {
eventSink.success(event);
}

@SuppressWarnings("deprecation")
private static void setAudioAttributes(SimpleExoPlayer exoPlayer) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
exoPlayer.setAudioAttributes(
new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build());
} else {
exoPlayer.setAudioStreamType(C.STREAM_TYPE_MUSIC);
}
exoPlayer.setAudioAttributes(
new AudioAttributes.Builder().setContentType(C.CONTENT_TYPE_MOVIE).build());
}

void play() {
Expand Down Expand Up @@ -303,12 +295,9 @@ public static void registerWith(Registrar registrar) {
new MethodChannel(registrar.messenger(), "flutter.io/videoPlayer");
channel.setMethodCallHandler(plugin);
registrar.addViewDestroyListener(
new PluginRegistry.ViewDestroyListener() {
@Override
public boolean onViewDestroy(FlutterNativeView view) {
plugin.onDestroy();
return false; // We are not interested in assuming ownership of the NativeView.
}
view -> {
plugin.onDestroy();
return false; // We are not interested in assuming ownership of the NativeView.
});
}

Expand Down
2 changes: 1 addition & 1 deletion packages/video_player/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: video_player
description: Flutter plugin for displaying inline video with other Flutter
widgets on Android and iOS.
author: Flutter Team <[email protected]>
version: 0.10.2+3
version: 0.10.2+4
homepage: https://github.com/flutter/plugins/tree/master/packages/video_player

flutter:
Expand Down