Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Fixes Playing video from asset on Android #3123

Merged
merged 4 commits into from Oct 28, 2020
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -8,7 +8,7 @@
import android.os.Build;
import android.util.Log;
import android.util.LongSparseArray;
import io.flutter.embedding.engine.loader.FlutterLoader;
import io.flutter.FlutterInjector;
import io.flutter.embedding.engine.plugins.FlutterPlugin;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.EventChannel;
Expand Down Expand Up @@ -60,6 +60,7 @@ public static void registerWith(io.flutter.plugin.common.PluginRegistry.Registra

@Override
public void onAttachedToEngine(FlutterPluginBinding binding) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra line

if (android.os.Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) {
try {
HttpsURLConnection.setDefaultSSLSocketFactory(new CustomSSLSocketFactory());
Expand All @@ -72,15 +73,15 @@ public void onAttachedToEngine(FlutterPluginBinding binding) {
e);
}
}

@SuppressWarnings("deprecation")
final FlutterLoader flutterLoader = FlutterLoader.getInstance();
final FlutterInjector injector = FlutterInjector.instance();

this.flutterState =
new FlutterState(
binding.getApplicationContext(),
binding.getBinaryMessenger(),
flutterLoader::getLookupKeyForAsset,
flutterLoader::getLookupKeyForAsset,
injector.flutterLoader()::getLookupKeyForAsset,
injector.flutterLoader()::getLookupKeyForAsset,
binding.getTextureRegistry());
flutterState.startListening(this, binding.getBinaryMessenger());
}
Expand Down