├── android ├── gradle.properties ├── app │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── mipmap-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ └── styles.xml │ │ │ │ └── drawable │ │ │ │ │ └── launch_background.xml │ │ │ ├── java │ │ │ │ └── tv │ │ │ │ │ └── mta │ │ │ │ │ └── jwplayer │ │ │ │ │ └── jwplayer_flutter │ │ │ │ │ ├── MainActivity.java │ │ │ │ │ └── jwplayer │ │ │ │ │ ├── PlayerViewFactory.java │ │ │ │ │ ├── PlayerView.java │ │ │ │ │ ├── KeepScreenOnHandler.java │ │ │ │ │ ├── PlayerLayout.java │ │ │ │ │ └── JWEventHandler.java │ │ │ └── AndroidManifest.xml │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ └── profile │ │ │ └── AndroidManifest.xml │ └── build.gradle ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── build.gradle ├── ios ├── Flutter │ ├── Debug.xcconfig │ ├── Release.xcconfig │ └── AppFrameworkInfo.plist ├── Runner │ ├── Runner-Bridging-Header.h │ ├── Assets.xcassets │ │ ├── LaunchImage.imageset │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ ├── README.md │ │ │ └── Contents.json │ │ └── AppIcon.appiconset │ │ │ ├── Icon-App-20x20@1x.png │ │ │ ├── Icon-App-20x20@2x.png │ │ │ ├── Icon-App-20x20@3x.png │ │ │ ├── Icon-App-29x29@1x.png │ │ │ ├── Icon-App-29x29@2x.png │ │ │ ├── Icon-App-29x29@3x.png │ │ │ ├── Icon-App-40x40@1x.png │ │ │ ├── Icon-App-40x40@2x.png │ │ │ ├── Icon-App-40x40@3x.png │ │ │ ├── Icon-App-60x60@2x.png │ │ │ ├── Icon-App-60x60@3x.png │ │ │ ├── Icon-App-76x76@1x.png │ │ │ ├── Icon-App-76x76@2x.png │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── Icon-App-83.5x83.5@2x.png │ │ │ └── Contents.json │ ├── jwplayer │ │ ├── PlayerViewFactory.swift │ │ ├── PlayerObserver.swift │ │ ├── PlayerView.swift │ │ └── PlayerDelegate.swift │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── Main.storyboard │ │ └── LaunchScreen.storyboard │ └── Info.plist ├── Runner.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ ├── IDEWorkspaceChecks.plist │ │ └── WorkspaceSettings.xcsettings └── Runner.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ ├── xcshareddata │ └── xcschemes │ │ └── Runner.xcscheme │ └── project.pbxproj ├── .metadata ├── README.md ├── test └── widget_test.dart ├── lib ├── main.dart └── player │ ├── PlayerObserver.dart │ └── MediaPlayer.dart ├── .gitignore ├── pubspec.yaml └── pubspec.lock /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Generated.xcconfig" 2 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | #import 3 | #import 4 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/angebagui/jwplayer_flutter/master/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Jun 23 08:50:38 CEST 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip 7 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: 7a4c33425ddd78c54aba07d86f3f9a4a0051769b 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | 3 | def flutterProjectRoot = rootProject.projectDir.parentFile.toPath() 4 | 5 | def plugins = new Properties() 6 | def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') 7 | if (pluginsFile.exists()) { 8 | pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } 9 | } 10 | 11 | plugins.each { name, path -> 12 | def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() 13 | include ":$name" 14 | project(":$name").projectDir = pluginDirectory 15 | } 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # jwplayer_flutter 2 | 3 | JWPlayer implementation in Google's Flutter framework 4 | 5 | ## Getting Started 6 | 7 | Follow the instruction on the link below to install Flutter. 8 | 9 | - [Flutter Install](https://flutter.dev/docs/get-started/install) 10 | 11 | Once installed, either use an IDE (IntelliJ IDEA) or use below Flutter command to run the project. Change directory to this project and run below command. 12 | 13 | `flutter run` 14 | 15 | You can also run the iOS project from XCode. Within the project, go to ios directory and open Runner.xcworkspace. 16 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.2.1' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | maven { 17 | url 'https://mvn.jwplayer.com/content/repositories/releases/' 18 | } 19 | } 20 | } 21 | 22 | rootProject.buildDir = '../build' 23 | subprojects { 24 | project.buildDir = "${rootProject.buildDir}/${project.name}" 25 | } 26 | subprojects { 27 | project.evaluationDependsOn(':app') 28 | } 29 | 30 | task clean(type: Delete) { 31 | delete rootProject.buildDir 32 | } 33 | -------------------------------------------------------------------------------- /ios/Runner/jwplayer/PlayerViewFactory.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public class PlayerViewFactory : NSObject, FlutterPlatformViewFactory { 4 | 5 | private var messenger:FlutterBinaryMessenger 6 | 7 | init(messenger:FlutterBinaryMessenger) { 8 | self.messenger = messenger 9 | super.init() 10 | } 11 | 12 | public func create(withFrame frame: CGRect, viewIdentifier viewId: Int64, arguments args: Any?) -> FlutterPlatformView { 13 | return PlayerView(frame: frame, viewId: viewId, messenger: messenger, args: args) 14 | } 15 | 16 | public func createArgsCodec() -> FlutterMessageCodec & NSObjectProtocol { 17 | return FlutterJSONMessageCodec() 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 8.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/jwplayer/PlayerObserver.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | extension PlayerView: FlutterStreamHandler { 4 | 5 | public func onListen(withArguments arguments: Any?, eventSink events: @escaping FlutterEventSink) -> FlutterError? { 6 | self.flutterEventSink = events 7 | self.playerDelegate = PlayerDelegate(eventSink: events) 8 | self.player?.delegate = self.playerDelegate 9 | return nil 10 | } 11 | 12 | public func onCancel(withArguments arguments: Any?) -> FlutterError? { 13 | self.flutterEventSink = nil 14 | return nil 15 | } 16 | 17 | func setupObserver() { 18 | 19 | /* register for Flutter event channel */ 20 | if let m = messenger { 21 | self.eventChannel = FlutterEventChannel(name: "tv.mta.jwplayer/JWEventHandler", binaryMessenger: m, codec: FlutterJSONMethodCodec.sharedInstance()) 22 | self.eventChannel?.setStreamHandler(self) 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @UIApplicationMain 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | 12 | let pluginRegistrar = registrar(forPlugin: "tv.mta.jwplayer/JWPlayerPlugin") 13 | 14 | let jwPlayerViewFactory = PlayerViewFactory(messenger: pluginRegistrar.messenger()) 15 | 16 | /* register JWPlayer view */ 17 | pluginRegistrar.register(jwPlayerViewFactory, withId: "tv.mta.jwplayer/JWPlayerView") 18 | 19 | /* setup audio session */ 20 | let audioSession = AVAudioSession.sharedInstance() 21 | do { 22 | try audioSession.setCategory(AVAudioSessionCategoryPlayback, with: []) 23 | try audioSession.setActive(true) 24 | } catch { 25 | print("Setting category to AVAudioSessionCategoryPlayback failed.") 26 | } 27 | 28 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter/material.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | import 'package:jwplayer_flutter/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Counter increments smoke test', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that our counter starts at 0. 19 | expect(find.text('0'), findsOneWidget); 20 | expect(find.text('1'), findsNothing); 21 | 22 | // Tap the '+' icon and trigger a frame. 23 | await tester.tap(find.byIcon(Icons.add)); 24 | await tester.pump(); 25 | 26 | // Verify that our counter has incremented. 27 | expect(find.text('0'), findsNothing); 28 | expect(find.text('1'), findsOneWidget); 29 | }); 30 | } 31 | -------------------------------------------------------------------------------- /lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | import 'player/MediaPlayer.dart'; 3 | 4 | void main() => runApp(MyApp()); 5 | 6 | class MyApp extends StatelessWidget { 7 | @override 8 | Widget build(BuildContext context) { 9 | return MaterialApp( 10 | title: 'JWPlayer Flutter', 11 | theme: ThemeData( 12 | primarySwatch: Colors.blue, 13 | ), 14 | home: Player(title: 'JWPlayer Flutter'), 15 | ); 16 | } 17 | } 18 | 19 | class Player extends StatelessWidget { 20 | Player({Key key, this.title}) : super(key: key); 21 | 22 | final String title; 23 | 24 | @override 25 | Widget build(BuildContext context) { 26 | return Scaffold( 27 | appBar: AppBar( 28 | title: Text(title), 29 | ), 30 | body: Center( 31 | child: Column( 32 | mainAxisAlignment: MainAxisAlignment.center, 33 | children: [ 34 | _buildMediaPlayer(), 35 | ], 36 | ), 37 | ), 38 | ); 39 | } 40 | 41 | Widget _buildMediaPlayer() { 42 | return MediaPlayer( 43 | true, 44 | /* auto play */ 45 | "http://qthttp.apple.com.edgesuite.net/1010qwoeiuryfg/sl.m3u8", /* file */ 46 | ); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /android/app/src/main/java/tv/mta/jwplayer/jwplayer_flutter/MainActivity.java: -------------------------------------------------------------------------------- 1 | package tv.mta.jwplayer.jwplayer_flutter; 2 | 3 | import android.content.res.Configuration; 4 | import android.os.Bundle; 5 | import io.flutter.app.FlutterActivity; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | import tv.mta.jwplayer.jwplayer_flutter.jwplayer.PlayerViewFactory; 8 | 9 | public class MainActivity extends FlutterActivity { 10 | private PlayerViewFactory playerViewFactory; 11 | 12 | @Override 13 | protected void onCreate(Bundle savedInstanceState) { 14 | 15 | super.onCreate(savedInstanceState); 16 | 17 | GeneratedPluginRegistrant.registerWith(this); 18 | 19 | Registrar registrar = registrarFor("tv.mta.jwplayer/JWPlayerPlugin"); 20 | 21 | playerViewFactory = new PlayerViewFactory(this, registrar.messenger()); 22 | 23 | registrar.platformViewRegistry().registerViewFactory("tv.mta.jwplayer/JWPlayerView", playerViewFactory); 24 | } 25 | 26 | @Override 27 | protected void onResume() { 28 | super.onResume(); 29 | 30 | if (playerViewFactory != null) { 31 | playerViewFactory.onResume(); 32 | } 33 | } 34 | 35 | @Override 36 | protected void onPause() { 37 | super.onPause(); 38 | 39 | if (playerViewFactory != null) { 40 | playerViewFactory.onPause(); 41 | } 42 | } 43 | 44 | @Override 45 | public void onConfigurationChanged(Configuration newConfig) { 46 | playerViewFactory.onConfigurationChange(newConfig); 47 | super.onConfigurationChanged(newConfig); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /android/app/src/main/java/tv/mta/jwplayer/jwplayer_flutter/jwplayer/PlayerViewFactory.java: -------------------------------------------------------------------------------- 1 | package tv.mta.jwplayer.jwplayer_flutter.jwplayer; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.res.Configuration; 6 | 7 | import io.flutter.plugin.common.BinaryMessenger; 8 | import io.flutter.plugin.common.JSONMessageCodec; 9 | import io.flutter.plugin.platform.PlatformView; 10 | import io.flutter.plugin.platform.PlatformViewFactory; 11 | 12 | public class PlayerViewFactory extends PlatformViewFactory { 13 | 14 | private final Activity activity; 15 | 16 | private PlayerView playerView; 17 | 18 | private BinaryMessenger messenger; 19 | 20 | public PlayerViewFactory(Activity activity, BinaryMessenger messenger) { 21 | super(JSONMessageCodec.INSTANCE); 22 | this.activity = activity; 23 | this.messenger = messenger; 24 | } 25 | 26 | @Override 27 | public PlatformView create(Context context, int id, Object args) { 28 | 29 | playerView = new PlayerView(context, activity, id, messenger, args); 30 | 31 | return playerView; 32 | } 33 | 34 | public void onResume() { 35 | if (playerView != null) { 36 | playerView.onResume(); 37 | } 38 | } 39 | 40 | public void onPause() { 41 | if (playerView != null) { 42 | playerView.onPause(); 43 | } 44 | } 45 | 46 | public void onConfigurationChange(Configuration newConfig) { 47 | if (playerView != null) { 48 | playerView.onConfigurationChange(newConfig); 49 | } 50 | } 51 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # Visual Studio Code related 19 | .vscode/ 20 | 21 | # Flutter/Dart/Pub related 22 | **/doc/api/ 23 | .dart_tool/ 24 | .flutter-plugins 25 | .packages 26 | .pub-cache/ 27 | .pub/ 28 | /build/ 29 | 30 | # Android related 31 | **/android/**/gradle-wrapper.jar 32 | **/android/.gradle 33 | **/android/captures/ 34 | **/android/gradlew 35 | **/android/gradlew.bat 36 | **/android/local.properties 37 | **/android/**/GeneratedPluginRegistrant.java 38 | 39 | # iOS/XCode related 40 | **/ios/**/*.mode1v3 41 | **/ios/**/*.mode2v3 42 | **/ios/**/*.moved-aside 43 | **/ios/**/*.pbxuser 44 | **/ios/**/*.perspectivev3 45 | **/ios/**/*sync/ 46 | **/ios/**/.sconsign.dblite 47 | **/ios/**/.tags* 48 | **/ios/**/.vagrant/ 49 | **/ios/**/DerivedData/ 50 | **/ios/**/Icon? 51 | **/ios/**/Pods/ 52 | **/ios/**/.symlinks/ 53 | **/ios/**/profile 54 | **/ios/**/xcuserdata 55 | **/ios/.generated/ 56 | **/ios/Flutter/App.framework 57 | **/ios/Flutter/Flutter.framework 58 | **/ios/Flutter/Generated.xcconfig 59 | **/ios/Flutter/app.flx 60 | **/ios/Flutter/app.zip 61 | **/ios/Flutter/flutter_assets/ 62 | **/ios/ServiceDefinitions.json 63 | **/ios/Runner/GeneratedPluginRegistrant.* 64 | **/ios/JWPlayer_iOS_SDK.framework 65 | 66 | # Exceptions to above rules. 67 | !**/ios/**/default.mode1v3 68 | !**/ios/**/default.mode2v3 69 | !**/ios/**/default.pbxuser 70 | !**/ios/**/default.perspectivev3 71 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 72 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | JWPlayerKey 6 | YOUR_KEY 7 | io.flutter.embedded_views_preview 8 | 9 | CFBundleDevelopmentRegion 10 | en 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | jwplayer_flutter 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(FLUTTER_BUILD_NAME) 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | $(FLUTTER_BUILD_NUMBER) 27 | LSRequiresIPhoneOS 28 | 29 | UILaunchStoryboardName 30 | LaunchScreen 31 | UIMainStoryboardFile 32 | Main 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | UIViewControllerBasedStatusBarAppearance 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /android/app/src/main/java/tv/mta/jwplayer/jwplayer_flutter/jwplayer/PlayerView.java: -------------------------------------------------------------------------------- 1 | package tv.mta.jwplayer.jwplayer_flutter.jwplayer; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.content.res.Configuration; 6 | import android.view.View; 7 | 8 | import io.flutter.plugin.common.BinaryMessenger; 9 | import io.flutter.plugin.common.MethodCall; 10 | import io.flutter.plugin.common.MethodChannel; 11 | import io.flutter.plugin.platform.PlatformView; 12 | 13 | public class PlayerView implements PlatformView, MethodChannel.MethodCallHandler { 14 | 15 | private final PlayerLayout player; 16 | 17 | private MethodChannel channel; 18 | 19 | PlayerView(Context context, Activity activity, int id, BinaryMessenger messenger, Object args) { 20 | 21 | channel = new MethodChannel(messenger, "tv.mta.jwplayer/JWPlayerView_" + id); 22 | channel.setMethodCallHandler(this); 23 | 24 | player = new PlayerLayout(context, activity, messenger, args); 25 | } 26 | 27 | @Override 28 | public View getView() { 29 | return player; 30 | } 31 | 32 | @Override 33 | public void dispose() { 34 | player.onHostDestroy(); 35 | } 36 | 37 | protected void onPause() { 38 | player.onHostPause(); 39 | } 40 | 41 | protected void onResume() { 42 | player.onHostResume(); 43 | } 44 | 45 | public void onConfigurationChange(Configuration newConfig) { 46 | player.onConfigurationChanged(newConfig); 47 | } 48 | 49 | @Override 50 | public void onMethodCall(MethodCall call, MethodChannel.Result result) { 51 | switch (call.method) { 52 | case "dispose": 53 | dispose(); 54 | result.success(true); 55 | break; 56 | default: 57 | result.notImplemented(); 58 | } 59 | } 60 | } -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 13 | 14 | 17 | 18 | 25 | 29 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /lib/player/PlayerObserver.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | 3 | class PlayerObserver { 4 | static final PlayerObserver _instance = PlayerObserver( 5 | EventChannel("tv.mta.jwplayer/JWEventHandler", JSONMethodCodec())); 6 | 7 | PlayerObserver(this.eventChannel); 8 | 9 | static PlayerObserver instance() { 10 | return _instance; 11 | } 12 | 13 | final EventChannel eventChannel; 14 | 15 | Function onFirstFrameCallback; 16 | Function onPlayerErrorCallback; 17 | 18 | bool isAutoPlay = false; 19 | 20 | void listen(Function firstFrameCallback, Function playerErrorCallback) async { 21 | onFirstFrameCallback = firstFrameCallback; 22 | onPlayerErrorCallback = playerErrorCallback; 23 | eventChannel.receiveBroadcastStream().listen(processEvent); 24 | } 25 | 26 | void processEvent(dynamic event) async { 27 | String eventName = event["name"]; 28 | 29 | switch (eventName) { 30 | 31 | /* onReady */ 32 | case "onReady": 33 | int setupTime = event["setupTime"]; 34 | break; 35 | 36 | /* onBeforePlay */ 37 | case "onBeforePlay": 38 | break; 39 | 40 | /* onFirstFrame */ 41 | case "onFirstFrame": 42 | break; 43 | 44 | /* onPause */ 45 | case "onPause": 46 | break; 47 | 48 | /* onPlayEvent */ 49 | case "onPlayEvent": 50 | break; 51 | 52 | /* onComplete */ 53 | case "onComplete": 54 | break; 55 | 56 | /* onTime */ 57 | case "onTime": 58 | double position = (event["position"].toDouble()).abs(); 59 | break; 60 | 61 | /* onSeek */ 62 | case "onSeek": 63 | 64 | /* position of the player before the player seeks (in seconds) */ 65 | int position = (event["position"]).toInt(); 66 | 67 | /* requested position to seek to (in seconds) */ 68 | double offset = double.parse("${event["offset"]}"); 69 | 70 | /* do something */ 71 | 72 | break; 73 | 74 | case "onError": 75 | /* do something */ 76 | break; 77 | 78 | default: 79 | break; 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /android/app/build.gradle: -------------------------------------------------------------------------------- 1 | def localProperties = new Properties() 2 | def localPropertiesFile = rootProject.file('local.properties') 3 | if (localPropertiesFile.exists()) { 4 | localPropertiesFile.withReader('UTF-8') { reader -> 5 | localProperties.load(reader) 6 | } 7 | } 8 | 9 | def flutterRoot = localProperties.getProperty('flutter.sdk') 10 | if (flutterRoot == null) { 11 | throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 12 | } 13 | 14 | def flutterVersionCode = localProperties.getProperty('flutter.versionCode') 15 | if (flutterVersionCode == null) { 16 | flutterVersionCode = '1' 17 | } 18 | 19 | def flutterVersionName = localProperties.getProperty('flutter.versionName') 20 | if (flutterVersionName == null) { 21 | flutterVersionName = '1.0' 22 | } 23 | 24 | apply plugin: 'com.android.application' 25 | apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" 26 | 27 | android { 28 | compileSdkVersion 28 29 | 30 | lintOptions { 31 | disable 'InvalidPackage' 32 | } 33 | 34 | defaultConfig { 35 | // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). 36 | applicationId "tv.mta.jwplayer.jwplayer_flutter" 37 | minSdkVersion 16 38 | targetSdkVersion 28 39 | versionCode flutterVersionCode.toInteger() 40 | versionName flutterVersionName 41 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 42 | } 43 | 44 | buildTypes { 45 | release { 46 | // TODO: Add your own signing config for the release build. 47 | // Signing with the debug keys for now, so `flutter run --release` works. 48 | signingConfig signingConfigs.debug 49 | } 50 | } 51 | } 52 | 53 | flutter { 54 | source '../..' 55 | } 56 | 57 | dependencies { 58 | testImplementation 'junit:junit:4.12' 59 | androidTestImplementation 'com.android.support.test:runner:1.0.2' 60 | androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' 61 | 62 | implementation 'com.longtailvideo.jwplayer:jwplayer-core:3.5.1' 63 | implementation 'com.longtailvideo.jwplayer:jwplayer-common:3.5.1' 64 | } 65 | -------------------------------------------------------------------------------- /ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: jwplayer_flutter 2 | description: JWPlayer implementation in Google's Flutter framework 3 | 4 | # The following defines the version and build number for your application. 5 | # A version number is three numbers separated by dots, like 1.2.43 6 | # followed by an optional build number separated by a +. 7 | # Both the version and the builder number may be overridden in flutter 8 | # build by specifying --build-name and --build-number, respectively. 9 | # In Android, build-name is used as versionName while build-number used as versionCode. 10 | # Read more about Android versioning at https://developer.android.com/studio/publish/versioning 11 | # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. 12 | # Read more about iOS versioning at 13 | # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html 14 | version: 1.0.0+1 15 | 16 | environment: 17 | sdk: ">=2.1.0 <3.0.0" 18 | 19 | dependencies: 20 | flutter: 21 | sdk: flutter 22 | 23 | # The following adds the Cupertino Icons font to your application. 24 | # Use with the CupertinoIcons class for iOS style icons. 25 | cupertino_icons: ^0.1.2 26 | 27 | dev_dependencies: 28 | flutter_test: 29 | sdk: flutter 30 | 31 | 32 | # For information on the generic Dart part of this file, see the 33 | # following page: https://www.dartlang.org/tools/pub/pubspec 34 | 35 | # The following section is specific to Flutter. 36 | flutter: 37 | 38 | # The following line ensures that the Material Icons font is 39 | # included with your application, so that you can use the icons in 40 | # the material Icons class. 41 | uses-material-design: true 42 | 43 | # To add assets to your application, add an assets section, like this: 44 | # assets: 45 | # - images/a_dot_burr.jpeg 46 | # - images/a_dot_ham.jpeg 47 | 48 | # An image asset can refer to one or more resolution-specific "variants", see 49 | # https://flutter.dev/assets-and-images/#resolution-aware. 50 | 51 | # For details regarding adding assets from package dependencies, see 52 | # https://flutter.dev/assets-and-images/#from-packages 53 | 54 | # To add custom fonts to your application, add a fonts section here, 55 | # in this "flutter" section. Each entry in this list should have a 56 | # "family" key with the font family name, and a "fonts" key with a 57 | # list giving the asset and other descriptors for the font. For 58 | # example: 59 | # fonts: 60 | # - family: Schyler 61 | # fonts: 62 | # - asset: fonts/Schyler-Regular.ttf 63 | # - asset: fonts/Schyler-Italic.ttf 64 | # style: italic 65 | # - family: Trajan Pro 66 | # fonts: 67 | # - asset: fonts/TrajanPro.ttf 68 | # - asset: fonts/TrajanPro_Bold.ttf 69 | # weight: 700 70 | # 71 | # For details regarding fonts from package dependencies, 72 | # see https://flutter.dev/custom-fonts/#from-packages 73 | -------------------------------------------------------------------------------- /ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /ios/Runner/jwplayer/PlayerView.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | public class PlayerView : NSObject, FlutterPlatformView { 4 | 5 | /* view specific properties */ 6 | var frame:CGRect 7 | var viewId:Int64 8 | 9 | /* JW Player properties */ 10 | var player: JWPlayerController? 11 | var playerDelegate:PlayerDelegate? 12 | var file:String = "" 13 | var autoPlay:Bool = false 14 | 15 | deinit { 16 | print("[dealloc] JWPLayer") 17 | } 18 | 19 | /* Flutter event streamer propertiews */ 20 | var messenger:FlutterBinaryMessenger? 21 | var eventChannel:FlutterEventChannel? 22 | var flutterEventSink:FlutterEventSink? 23 | var channel: FlutterMethodChannel? 24 | 25 | init(frame:CGRect, viewId: Int64, messenger: FlutterBinaryMessenger, args: Any?) { 26 | 27 | /* set view properties */ 28 | self.frame = frame 29 | self.viewId = viewId 30 | 31 | super.init() 32 | 33 | /* set Flutter messenger */ 34 | self.messenger = messenger 35 | self.channel = FlutterMethodChannel(name: "tv.mta.jwplayer/JWPlayerView_" + String(viewId), binaryMessenger: messenger) 36 | self.channel?.setMethodCallHandler(self.handle) 37 | 38 | /* data as JSON */ 39 | let parsedData = args as! [String: Any] 40 | 41 | /* set incoming player properties */ 42 | self.file = parsedData["file"] as! String 43 | self.autoPlay = parsedData["autoPlay"] as! Bool 44 | } 45 | 46 | public func view() -> UIView { 47 | 48 | let playListItem = JWPlaylistItem() 49 | playListItem.file = file; 50 | 51 | let config = JWConfig() 52 | config.playlist = [playListItem]; 53 | config.autostart = self.autoPlay 54 | 55 | player = JWPlayerController(config:config) 56 | 57 | player?.view.frame = self.frame; 58 | player?.view.autoresizingMask = [ 59 | .flexibleBottomMargin, 60 | .flexibleHeight, 61 | .flexibleLeftMargin, 62 | .flexibleRightMargin, 63 | .flexibleTopMargin, 64 | .flexibleWidth]; 65 | 66 | player?.forceFullScreenOnLandscape = true; 67 | player?.forceLandscapeOnFullScreen = true; 68 | player?.displayLockScreenControls = true; 69 | 70 | /* start listening for player events */ 71 | setupObserver() 72 | 73 | return (player?.view!)! 74 | } 75 | 76 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 77 | switch call.method { 78 | case "dispose": 79 | dispose() 80 | result(true) 81 | break 82 | default: 83 | result(FlutterMethodNotImplemented) 84 | break 85 | } 86 | } 87 | 88 | public func dispose() { 89 | if self.player != nil { 90 | self.player?.stop() 91 | self.player = nil 92 | } 93 | 94 | self.flutterEventSink = nil 95 | self.eventChannel?.setStreamHandler(nil) 96 | self.channel = nil 97 | self.messenger = nil 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /android/app/src/main/java/tv/mta/jwplayer/jwplayer_flutter/jwplayer/KeepScreenOnHandler.java: -------------------------------------------------------------------------------- 1 | package tv.mta.jwplayer.jwplayer_flutter.jwplayer; 2 | 3 | import android.view.Window; 4 | import android.view.WindowManager; 5 | 6 | import com.longtailvideo.jwplayer.JWPlayerView; 7 | import com.longtailvideo.jwplayer.events.AdCompleteEvent; 8 | import com.longtailvideo.jwplayer.events.AdErrorEvent; 9 | import com.longtailvideo.jwplayer.events.AdPauseEvent; 10 | import com.longtailvideo.jwplayer.events.AdPlayEvent; 11 | import com.longtailvideo.jwplayer.events.AdSkippedEvent; 12 | import com.longtailvideo.jwplayer.events.CompleteEvent; 13 | import com.longtailvideo.jwplayer.events.ErrorEvent; 14 | import com.longtailvideo.jwplayer.events.PauseEvent; 15 | import com.longtailvideo.jwplayer.events.PlayEvent; 16 | import com.longtailvideo.jwplayer.events.listeners.AdvertisingEvents; 17 | import com.longtailvideo.jwplayer.events.listeners.VideoPlayerEvents; 18 | 19 | public class KeepScreenOnHandler implements VideoPlayerEvents.OnPlayListener, 20 | VideoPlayerEvents.OnPauseListener, 21 | VideoPlayerEvents.OnCompleteListener, 22 | VideoPlayerEvents.OnErrorListener, 23 | AdvertisingEvents.OnAdPlayListener, 24 | AdvertisingEvents.OnAdPauseListener, 25 | AdvertisingEvents.OnAdCompleteListener, 26 | AdvertisingEvents.OnAdSkippedListener, 27 | AdvertisingEvents.OnAdErrorListener { 28 | 29 | /** 30 | * The application window 31 | */ 32 | private Window mWindow; 33 | 34 | public KeepScreenOnHandler(JWPlayerView jwPlayerView, Window window) { 35 | jwPlayerView.addOnPlayListener(this); 36 | jwPlayerView.addOnPauseListener(this); 37 | jwPlayerView.addOnCompleteListener(this); 38 | jwPlayerView.addOnErrorListener(this); 39 | jwPlayerView.addOnAdPlayListener(this); 40 | jwPlayerView.addOnAdPauseListener(this); 41 | jwPlayerView.addOnAdCompleteListener(this); 42 | jwPlayerView.addOnAdErrorListener(this); 43 | mWindow = window; 44 | } 45 | 46 | private void updateWakeLock(boolean enable) { 47 | if (enable) { 48 | mWindow.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 49 | } else { 50 | mWindow.clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 51 | } 52 | } 53 | 54 | @Override 55 | public void onError(ErrorEvent errorEvent) { 56 | updateWakeLock(false); 57 | } 58 | 59 | @Override 60 | public void onAdPlay(AdPlayEvent adPlayEvent) { 61 | updateWakeLock(true); 62 | } 63 | 64 | @Override 65 | public void onAdPause(AdPauseEvent adPauseEvent) { 66 | updateWakeLock(false); 67 | } 68 | 69 | @Override 70 | public void onAdComplete(AdCompleteEvent adCompleteEvent) { 71 | updateWakeLock(false); 72 | } 73 | 74 | @Override 75 | public void onAdSkipped(AdSkippedEvent adSkippedEvent) { 76 | updateWakeLock(false); 77 | } 78 | 79 | @Override 80 | public void onAdError(AdErrorEvent adErrorEvent) { 81 | updateWakeLock(false); 82 | } 83 | 84 | @Override 85 | public void onComplete(CompleteEvent completeEvent) { 86 | updateWakeLock(false); 87 | } 88 | 89 | @Override 90 | public void onPause(PauseEvent pauseEvent) { 91 | updateWakeLock(false); 92 | 93 | } 94 | 95 | @Override 96 | public void onPlay(PlayEvent playEvent) { 97 | updateWakeLock(true); 98 | 99 | } 100 | 101 | /* player destroyed */ 102 | public void destroy() { 103 | updateWakeLock(false); 104 | } 105 | } -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://www.dartlang.org/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | url: "https://pub.dartlang.org" 9 | source: hosted 10 | version: "2.1.0" 11 | boolean_selector: 12 | dependency: transitive 13 | description: 14 | name: boolean_selector 15 | url: "https://pub.dartlang.org" 16 | source: hosted 17 | version: "1.0.4" 18 | charcode: 19 | dependency: transitive 20 | description: 21 | name: charcode 22 | url: "https://pub.dartlang.org" 23 | source: hosted 24 | version: "1.1.2" 25 | collection: 26 | dependency: transitive 27 | description: 28 | name: collection 29 | url: "https://pub.dartlang.org" 30 | source: hosted 31 | version: "1.14.11" 32 | cupertino_icons: 33 | dependency: "direct main" 34 | description: 35 | name: cupertino_icons 36 | url: "https://pub.dartlang.org" 37 | source: hosted 38 | version: "0.1.2" 39 | flutter: 40 | dependency: "direct main" 41 | description: flutter 42 | source: sdk 43 | version: "0.0.0" 44 | flutter_test: 45 | dependency: "direct dev" 46 | description: flutter 47 | source: sdk 48 | version: "0.0.0" 49 | matcher: 50 | dependency: transitive 51 | description: 52 | name: matcher 53 | url: "https://pub.dartlang.org" 54 | source: hosted 55 | version: "0.12.5" 56 | meta: 57 | dependency: transitive 58 | description: 59 | name: meta 60 | url: "https://pub.dartlang.org" 61 | source: hosted 62 | version: "1.1.6" 63 | path: 64 | dependency: transitive 65 | description: 66 | name: path 67 | url: "https://pub.dartlang.org" 68 | source: hosted 69 | version: "1.6.2" 70 | pedantic: 71 | dependency: transitive 72 | description: 73 | name: pedantic 74 | url: "https://pub.dartlang.org" 75 | source: hosted 76 | version: "1.5.0" 77 | quiver: 78 | dependency: transitive 79 | description: 80 | name: quiver 81 | url: "https://pub.dartlang.org" 82 | source: hosted 83 | version: "2.0.2" 84 | sky_engine: 85 | dependency: transitive 86 | description: flutter 87 | source: sdk 88 | version: "0.0.99" 89 | source_span: 90 | dependency: transitive 91 | description: 92 | name: source_span 93 | url: "https://pub.dartlang.org" 94 | source: hosted 95 | version: "1.5.5" 96 | stack_trace: 97 | dependency: transitive 98 | description: 99 | name: stack_trace 100 | url: "https://pub.dartlang.org" 101 | source: hosted 102 | version: "1.9.3" 103 | stream_channel: 104 | dependency: transitive 105 | description: 106 | name: stream_channel 107 | url: "https://pub.dartlang.org" 108 | source: hosted 109 | version: "2.0.0" 110 | string_scanner: 111 | dependency: transitive 112 | description: 113 | name: string_scanner 114 | url: "https://pub.dartlang.org" 115 | source: hosted 116 | version: "1.0.4" 117 | term_glyph: 118 | dependency: transitive 119 | description: 120 | name: term_glyph 121 | url: "https://pub.dartlang.org" 122 | source: hosted 123 | version: "1.1.0" 124 | test_api: 125 | dependency: transitive 126 | description: 127 | name: test_api 128 | url: "https://pub.dartlang.org" 129 | source: hosted 130 | version: "0.2.4" 131 | typed_data: 132 | dependency: transitive 133 | description: 134 | name: typed_data 135 | url: "https://pub.dartlang.org" 136 | source: hosted 137 | version: "1.1.6" 138 | vector_math: 139 | dependency: transitive 140 | description: 141 | name: vector_math 142 | url: "https://pub.dartlang.org" 143 | source: hosted 144 | version: "2.0.8" 145 | sdks: 146 | dart: ">=2.2.0 <3.0.0" 147 | -------------------------------------------------------------------------------- /lib/player/MediaPlayer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:flutter/foundation.dart'; 4 | import 'package:flutter/gestures.dart'; 5 | import 'package:flutter/material.dart'; 6 | import 'package:flutter/services.dart'; 7 | 8 | import 'PlayerObserver.dart'; 9 | 10 | class MediaPlayer extends StatefulWidget { 11 | final bool autoPlay; 12 | final String file; 13 | final String thumbnail; 14 | 15 | MediaPlayer(this.autoPlay, this.file, {this.thumbnail, Key key}) 16 | : super(key: key); 17 | 18 | @override 19 | MediaPlayerState createState() => new MediaPlayerState(); 20 | } 21 | 22 | class MediaPlayerState extends State { 23 | PlayerObserver playerObserver; 24 | int _platformViewId; 25 | bool _isPlaying = false; 26 | 27 | @override 28 | void initState() { 29 | super.initState(); 30 | _isPlaying = widget.autoPlay; 31 | } 32 | 33 | @override 34 | void didUpdateWidget(MediaPlayer oldWidget) { 35 | super.didUpdateWidget(oldWidget); 36 | } 37 | 38 | @override 39 | void dispose() { 40 | _disposePlatformView(_platformViewId, isDisposing: true); 41 | super.dispose(); 42 | } 43 | 44 | @override 45 | Widget build(BuildContext context) { 46 | Widget playerWidget = Container( 47 | color: Colors.black87, 48 | ); 49 | 50 | /* setup player */ 51 | if (widget.file != null) { 52 | if (playerObserver == null) { 53 | playerObserver = PlayerObserver.instance(); 54 | } 55 | 56 | playerObserver.isAutoPlay = widget.autoPlay; 57 | 58 | /* Android */ 59 | if (Platform.isAndroid) { 60 | playerWidget = AndroidView( 61 | viewType: 'tv.mta.jwplayer/JWPlayerView', 62 | gestureRecognizers: Set() 63 | ..add(Factory( 64 | () => HorizontalDragGestureRecognizer())) 65 | ..add(Factory(() => TapGestureRecognizer())), 66 | creationParams: { 67 | "autoPlay": _isPlaying, 68 | "file": widget.file, 69 | }, 70 | creationParamsCodec: const JSONMessageCodec(), 71 | onPlatformViewCreated: (viewId) { 72 | _platformViewId = viewId; 73 | playerObserver.listen(_onFirstFrame, _onPlayerError); 74 | }, 75 | ); 76 | } 77 | 78 | /* iOS */ 79 | else if (Platform.isIOS) { 80 | playerWidget = UiKitView( 81 | viewType: 'tv.mta.jwplayer/JWPlayerView', 82 | gestureRecognizers: Set() 83 | ..add(Factory( 84 | () => HorizontalDragGestureRecognizer())) 85 | ..add(Factory(() => TapGestureRecognizer())), 86 | creationParams: { 87 | "autoPlay": _isPlaying, 88 | "file": widget.file, 89 | }, 90 | creationParamsCodec: const JSONMessageCodec(), 91 | onPlatformViewCreated: (viewId) { 92 | _platformViewId = viewId; 93 | playerObserver.listen(_onFirstFrame, _onPlayerError); 94 | }, 95 | ); 96 | } 97 | } else { 98 | _disposePlatformView(_platformViewId); 99 | } 100 | 101 | /* render player */ 102 | return AspectRatio( 103 | aspectRatio: 16 / 9, 104 | child: playerWidget, 105 | ); 106 | } 107 | 108 | void _onFirstFrame() async { 109 | /* first frame */ 110 | } 111 | 112 | void _onPlayerError() async { 113 | /* player error */ 114 | } 115 | 116 | void _disposePlatformView(int viewId, {bool isDisposing = false}) { 117 | if (viewId != null) { 118 | var methodChannel = 119 | MethodChannel("tv.mta.jwplayer/JWPlayerView_${viewId}"); 120 | 121 | /* clean platform view */ 122 | methodChannel.invokeMethod("dispose"); 123 | 124 | if (!isDisposing) { 125 | setState(() { 126 | _platformViewId = null; 127 | }); 128 | } 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /android/app/src/main/java/tv/mta/jwplayer/jwplayer_flutter/jwplayer/PlayerLayout.java: -------------------------------------------------------------------------------- 1 | package tv.mta.jwplayer.jwplayer_flutter.jwplayer; 2 | 3 | import android.app.ActionBar; 4 | import android.app.Activity; 5 | import android.content.Context; 6 | import android.content.res.Configuration; 7 | import android.support.annotation.NonNull; 8 | import android.view.KeyEvent; 9 | import android.widget.FrameLayout; 10 | 11 | import com.longtailvideo.jwplayer.JWPlayerView; 12 | import com.longtailvideo.jwplayer.configuration.PlayerConfig; 13 | import com.longtailvideo.jwplayer.events.FullscreenEvent; 14 | import com.longtailvideo.jwplayer.events.listeners.VideoPlayerEvents; 15 | 16 | import org.json.JSONObject; 17 | 18 | import io.flutter.plugin.common.BinaryMessenger; 19 | import io.flutter.plugin.common.EventChannel; 20 | import io.flutter.plugin.common.JSONMethodCodec; 21 | 22 | public class PlayerLayout extends FrameLayout implements VideoPlayerEvents.OnFullscreenListener { 23 | 24 | /** 25 | * Reference to the {@link JWPlayerView} 26 | */ 27 | private JWPlayerView mPlayerView; 28 | 29 | /** 30 | * Reference to the {@link PlayerConfig} 31 | */ 32 | private PlayerConfig playerConfig = new PlayerConfig.Builder().build(); 33 | 34 | /** 35 | * An instance of our event handling class 36 | */ 37 | private JWEventHandler mEventHandler; 38 | 39 | /** 40 | * App main activity 41 | */ 42 | private Activity activity; 43 | 44 | private BinaryMessenger messenger; 45 | private EventChannel eventChannel; 46 | 47 | private KeepScreenOnHandler keepScreenOnHandler; 48 | 49 | public PlayerLayout(@NonNull Context context, Activity activity, BinaryMessenger messenger, Object arguments) { 50 | super(context); 51 | 52 | this.activity = activity; 53 | 54 | this.messenger = messenger; 55 | 56 | try { 57 | 58 | JSONObject args = (JSONObject) arguments; 59 | 60 | setFile(args.getString("file")); 61 | 62 | setAutoPlay(args.getBoolean("autoPlay")); 63 | 64 | } catch (Exception e) { /* ignore */ } 65 | } 66 | 67 | private void initPlayer() { 68 | 69 | mPlayerView = new JWPlayerView(this.activity, playerConfig); 70 | 71 | /* handle hiding/showing of ActionBar */ 72 | mPlayerView.addOnFullscreenListener(this); 73 | 74 | /* enable background audio */ 75 | mPlayerView.setBackgroundAudio(true); 76 | 77 | /* keep the screen on during playback */ 78 | keepScreenOnHandler = new KeepScreenOnHandler(mPlayerView, this.activity.getWindow()); 79 | 80 | mEventHandler = new JWEventHandler(mPlayerView); 81 | 82 | eventChannel = new EventChannel( 83 | messenger, 84 | "tv.mta.jwplayer/JWEventHandler", 85 | JSONMethodCodec.INSTANCE); 86 | 87 | eventChannel.setStreamHandler(mEventHandler); 88 | 89 | this.addView(mPlayerView); 90 | } 91 | 92 | public void setFile(String file) { 93 | 94 | playerConfig.setFile(file); 95 | 96 | initPlayer(); 97 | } 98 | 99 | public void setAutoPlay(Boolean autoPlay) { 100 | 101 | playerConfig.setAutostart(autoPlay); 102 | 103 | if (mPlayerView != null && autoPlay) { 104 | mPlayerView.play(); 105 | } 106 | } 107 | 108 | @Override 109 | public void onConfigurationChanged(Configuration newConfig) { 110 | 111 | /* set fullscreen when the device is rotated to landscape */ 112 | if (mPlayerView != null) { 113 | mPlayerView.setFullscreen(newConfig.orientation == Configuration.ORIENTATION_LANDSCAPE, true); 114 | } 115 | 116 | super.onConfigurationChanged(newConfig); 117 | } 118 | 119 | @Override 120 | public boolean onKeyDown(int keyCode, KeyEvent event) { 121 | /* exit fullscreen when the user pressed the Back button */ 122 | if (keyCode == KeyEvent.KEYCODE_BACK) { 123 | if (mPlayerView.getFullscreen()) { 124 | mPlayerView.setFullscreen(false, true); 125 | return false; 126 | } 127 | } 128 | return super.onKeyDown(keyCode, event); 129 | } 130 | 131 | @Override 132 | public void onFullscreen(FullscreenEvent fullscreenEvent) { 133 | ActionBar actionBar = this.activity.getActionBar(); 134 | if (actionBar != null) { 135 | if (fullscreenEvent.getFullscreen()) { 136 | actionBar.hide(); 137 | } else { 138 | actionBar.show(); 139 | } 140 | } 141 | } 142 | 143 | public void retryFailedPlayback() { 144 | 145 | try { 146 | 147 | /* retry playback */ 148 | mPlayerView.play(); 149 | 150 | } catch (Exception e) { /* ignore */ } 151 | } 152 | 153 | public void onHostResume() { 154 | 155 | try { 156 | 157 | /* let JW Player know that the app has returned from the background */ 158 | mPlayerView.onResume(); 159 | 160 | } catch (Exception e) { /* ignore */ } 161 | } 162 | 163 | public void onHostPause() { 164 | 165 | try { 166 | 167 | /* let JW Player know that the app is going to the background */ 168 | mPlayerView.onPause(); 169 | 170 | } catch (Exception e) { /* ignore */ } 171 | } 172 | 173 | public void onHostDestroy() { 174 | 175 | try { 176 | 177 | /* stop controlling screen wake lock */ 178 | keepScreenOnHandler.destroy(); 179 | 180 | /* let JW Player know that the app is being destroyed */ 181 | mPlayerView.onDestroy(); 182 | 183 | } catch (Exception e) { /* ignore */ } 184 | } 185 | } -------------------------------------------------------------------------------- /ios/Runner/jwplayer/PlayerDelegate.swift: -------------------------------------------------------------------------------- 1 | import Foundation 2 | 3 | class PlayerDelegate: NSObject, JWPlayerDelegate { 4 | 5 | var flutterEventSink:FlutterEventSink? 6 | 7 | init(eventSink:@escaping FlutterEventSink) { 8 | self.flutterEventSink = eventSink 9 | } 10 | 11 | public func onReady(_ event: (JWEvent & JWReadyEvent)!) { 12 | self.flutterEventSink?(["name":"onReady", "setupTime":event.setupTime]) 13 | } 14 | 15 | public func onAudioTracks(_ event: (JWEvent & JWLevelsEvent)!) { 16 | self.flutterEventSink?(["name":"onAudioTracks"]) 17 | } 18 | 19 | public func onBeforeComplete() { 20 | self.flutterEventSink?(["name":"onBeforeComplete"]) 21 | } 22 | 23 | public func onBeforePlay() { 24 | self.flutterEventSink?(["name":"onBeforePlay"]) 25 | } 26 | 27 | public func onBuffer(_ event: (JWEvent & JWBufferEvent)!) { 28 | self.flutterEventSink?(["name":"onBuffer"]) 29 | } 30 | 31 | public func onCaptionsList(_ event: (JWEvent & JWCaptionsListEvent)!) { 32 | self.flutterEventSink?(["name":"onCaptionsList"]) 33 | } 34 | 35 | public func onComplete() { 36 | self.flutterEventSink?(["name":"onComplete"]) 37 | } 38 | 39 | public func onFullscreen(_ event: (JWEvent & JWFullscreenEvent)!) { 40 | self.flutterEventSink?(["name":"onFullscreen", "fullscreen":event.fullscreen]) 41 | } 42 | 43 | public func onIdle(_ event: (JWEvent & JWStateChangeEvent)!) { 44 | self.flutterEventSink?(["name":"onIdle", "oldState":event.oldState]) 45 | } 46 | 47 | public func onMeta(_ event: (JWEvent & JWMetaEvent)!) { 48 | self.flutterEventSink?(["name":"onMeta"]) 49 | } 50 | 51 | public func onPause(_ event: (JWEvent & JWStateChangeEvent)!) { 52 | self.flutterEventSink?(["name":"onPause"]) 53 | } 54 | 55 | public func onPlay(_ event: (JWEvent & JWStateChangeEvent)!) { 56 | self.flutterEventSink?(["name":"onPlay", "oldState":event.oldState]) 57 | } 58 | 59 | public func onPlaylistComplete() { 60 | self.flutterEventSink?(["name":"onPlaylistComplete"]) 61 | } 62 | 63 | public func onPlaylistItem(_ event: (JWEvent & JWPlaylistItemEvent)!) { 64 | self.flutterEventSink?(["name":"onPlaylistItem", "index":event.index]) 65 | } 66 | 67 | public func onPlaylist(_ event: (JWEvent & JWPlaylistEvent)!) { 68 | self.flutterEventSink?(["name":"onPlaylist"]) 69 | } 70 | 71 | public func onSeek(_ event: (JWEvent & JWSeekEvent)!) { 72 | self.flutterEventSink?(["name":"onSeek", "offset":event.offset, "position":event.position]) 73 | } 74 | 75 | public func onSetupError(_ event: (JWEvent & JWErrorEvent)!) { 76 | self.flutterEventSink?(["name":"onSetupError"]) 77 | } 78 | 79 | public func onAdError(_ event: (JWAdEvent & JWErrorEvent)!) { 80 | self.flutterEventSink?(["name":"onAdError"]) 81 | } 82 | 83 | public func onError(_ event: (JWEvent & JWErrorEvent)!) { 84 | self.flutterEventSink?(["name":"onError"]) 85 | } 86 | 87 | public func onLevelsChanged(_ event: (JWEvent & JWLevelsChangedEvent)!) { 88 | self.flutterEventSink?(["name":"onLevelsChanged"]) 89 | } 90 | 91 | public func onLevels(_ event: (JWEvent & JWLevelsEvent)!) { 92 | self.flutterEventSink?(["name":"onLevels"]) 93 | } 94 | 95 | public func onAudioTrackChanged(_ event: (JWEvent & JWTrackChangedEvent)!) { 96 | self.flutterEventSink?(["name":"onAudioTrackChanged"]) 97 | } 98 | 99 | public func onCaptionsChanged(_ event: (JWEvent & JWTrackChangedEvent)!) { 100 | self.flutterEventSink?(["name":"onCaptionsChanged"]) 101 | } 102 | 103 | public func onAdClick(_ event: (JWAdEvent & JWAdDetailEvent)!) { 104 | self.flutterEventSink?(["name":"onAdClick"]) 105 | } 106 | 107 | public func onAdComplete(_ event: (JWAdEvent & JWAdDetailEvent)!) { 108 | self.flutterEventSink?(["name":"onAdComplete"]) 109 | } 110 | 111 | public func onAdSkipped(_ event: (JWAdEvent & JWAdDetailEvent)!) { 112 | self.flutterEventSink?(["name":"onAdSkipped"]) 113 | } 114 | 115 | public func onAdImpression(_ event: (JWAdEvent & JWAdImpressionEvent)!) { 116 | self.flutterEventSink?(["name":"onAdImpression"]) 117 | } 118 | 119 | public func onAdPause(_ event: (JWAdEvent & JWAdStateChangeEvent)!) { 120 | self.flutterEventSink?(["name":"onAdPause"]) 121 | } 122 | 123 | public func onAdPlay(_ event: (JWAdEvent & JWAdStateChangeEvent)!) { 124 | self.flutterEventSink?(["name":"onAdPlay"]) 125 | } 126 | 127 | public func onSeeked() { 128 | self.flutterEventSink?(["name":"onSeeked"]) 129 | } 130 | 131 | public func onControls(_ event: (JWEvent & JWControlsEvent)!) { 132 | self.flutterEventSink?(["name":"onControls", "controls":event.controls]) 133 | } 134 | 135 | public func onControlBarVisible(_ event: (JWEvent & JWControlsEvent)!) { 136 | self.flutterEventSink?(["name":"onControlBarVisible", "controls":event.controls]) 137 | } 138 | 139 | public func onDisplayClick() { 140 | self.flutterEventSink?(["name":"onDisplayClick"]) 141 | } 142 | 143 | public func onFirstFrame(_ event: (JWEvent & JWFirstFrameEvent)!) { 144 | self.flutterEventSink?(["name":"onFirstFrame", "loadTime":event.loadTime]) 145 | } 146 | 147 | public func onAdSchedule(_ event: (JWAdEvent & JWAdScheduleEvent)!) { 148 | self.flutterEventSink?(["name":"onAdSchedule"]) 149 | } 150 | 151 | public func onTime(_ event: (JWEvent & JWTimeEvent)!) { 152 | self.flutterEventSink?(["name":"onTime", "duration":event.duration, "position":event.position]) 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /android/app/src/main/java/tv/mta/jwplayer/jwplayer_flutter/jwplayer/JWEventHandler.java: -------------------------------------------------------------------------------- 1 | package tv.mta.jwplayer.jwplayer_flutter.jwplayer; 2 | 3 | import android.util.Log; 4 | 5 | import com.longtailvideo.jwplayer.JWPlayerView; 6 | import com.longtailvideo.jwplayer.events.AdClickEvent; 7 | import com.longtailvideo.jwplayer.events.AdCompleteEvent; 8 | import com.longtailvideo.jwplayer.events.AdErrorEvent; 9 | import com.longtailvideo.jwplayer.events.AdImpressionEvent; 10 | import com.longtailvideo.jwplayer.events.AdPauseEvent; 11 | import com.longtailvideo.jwplayer.events.AdPlayEvent; 12 | import com.longtailvideo.jwplayer.events.AdScheduleEvent; 13 | import com.longtailvideo.jwplayer.events.AdSkippedEvent; 14 | import com.longtailvideo.jwplayer.events.AdTimeEvent; 15 | import com.longtailvideo.jwplayer.events.AudioTrackChangedEvent; 16 | import com.longtailvideo.jwplayer.events.AudioTracksEvent; 17 | import com.longtailvideo.jwplayer.events.BeforeCompleteEvent; 18 | import com.longtailvideo.jwplayer.events.BeforePlayEvent; 19 | import com.longtailvideo.jwplayer.events.BufferEvent; 20 | import com.longtailvideo.jwplayer.events.CaptionsChangedEvent; 21 | import com.longtailvideo.jwplayer.events.CaptionsListEvent; 22 | import com.longtailvideo.jwplayer.events.CompleteEvent; 23 | import com.longtailvideo.jwplayer.events.ControlBarVisibilityEvent; 24 | import com.longtailvideo.jwplayer.events.ControlsEvent; 25 | import com.longtailvideo.jwplayer.events.DisplayClickEvent; 26 | import com.longtailvideo.jwplayer.events.ErrorEvent; 27 | import com.longtailvideo.jwplayer.events.FirstFrameEvent; 28 | import com.longtailvideo.jwplayer.events.FullscreenEvent; 29 | import com.longtailvideo.jwplayer.events.IdleEvent; 30 | import com.longtailvideo.jwplayer.events.LevelsChangedEvent; 31 | import com.longtailvideo.jwplayer.events.LevelsEvent; 32 | import com.longtailvideo.jwplayer.events.MetaEvent; 33 | import com.longtailvideo.jwplayer.events.MuteEvent; 34 | import com.longtailvideo.jwplayer.events.PauseEvent; 35 | import com.longtailvideo.jwplayer.events.PlayEvent; 36 | import com.longtailvideo.jwplayer.events.PlaylistCompleteEvent; 37 | import com.longtailvideo.jwplayer.events.PlaylistEvent; 38 | import com.longtailvideo.jwplayer.events.PlaylistItemEvent; 39 | import com.longtailvideo.jwplayer.events.ReadyEvent; 40 | import com.longtailvideo.jwplayer.events.SeekEvent; 41 | import com.longtailvideo.jwplayer.events.SeekedEvent; 42 | import com.longtailvideo.jwplayer.events.SetupErrorEvent; 43 | import com.longtailvideo.jwplayer.events.TimeEvent; 44 | import com.longtailvideo.jwplayer.events.VisualQualityEvent; 45 | import com.longtailvideo.jwplayer.events.listeners.AdvertisingEvents; 46 | import com.longtailvideo.jwplayer.events.listeners.VideoPlayerEvents; 47 | 48 | import org.json.JSONObject; 49 | 50 | import io.flutter.plugin.common.EventChannel; 51 | 52 | public class JWEventHandler implements VideoPlayerEvents.OnSetupErrorListener, 53 | VideoPlayerEvents.OnPlaylistListener, 54 | VideoPlayerEvents.OnPlaylistItemListener, 55 | VideoPlayerEvents.OnPlayListener, 56 | VideoPlayerEvents.OnPauseListener, 57 | VideoPlayerEvents.OnBufferListener, 58 | VideoPlayerEvents.OnIdleListener, 59 | VideoPlayerEvents.OnErrorListener, 60 | VideoPlayerEvents.OnSeekListener, 61 | VideoPlayerEvents.OnTimeListener, 62 | VideoPlayerEvents.OnFullscreenListener, 63 | VideoPlayerEvents.OnAudioTracksListener, 64 | VideoPlayerEvents.OnAudioTrackChangedListener, 65 | VideoPlayerEvents.OnCaptionsListListener, 66 | VideoPlayerEvents.OnMetaListener, 67 | VideoPlayerEvents.OnPlaylistCompleteListener, 68 | VideoPlayerEvents.OnCompleteListener, 69 | VideoPlayerEvents.OnLevelsChangedListener, 70 | VideoPlayerEvents.OnLevelsListener, 71 | VideoPlayerEvents.OnCaptionsChangedListener, 72 | VideoPlayerEvents.OnControlsListener, 73 | VideoPlayerEvents.OnControlBarVisibilityListener, 74 | VideoPlayerEvents.OnDisplayClickListener, 75 | VideoPlayerEvents.OnMuteListener, 76 | VideoPlayerEvents.OnSeekedListener, 77 | VideoPlayerEvents.OnVisualQualityListener, 78 | VideoPlayerEvents.OnFirstFrameListener, 79 | VideoPlayerEvents.OnReadyListener, 80 | AdvertisingEvents.OnAdClickListener, 81 | AdvertisingEvents.OnAdCompleteListener, 82 | AdvertisingEvents.OnAdSkippedListener, 83 | AdvertisingEvents.OnAdErrorListener, 84 | AdvertisingEvents.OnAdImpressionListener, 85 | AdvertisingEvents.OnAdTimeListener, 86 | AdvertisingEvents.OnAdPauseListener, 87 | AdvertisingEvents.OnAdPlayListener, 88 | AdvertisingEvents.OnAdScheduleListener, 89 | AdvertisingEvents.OnBeforePlayListener, 90 | AdvertisingEvents.OnBeforeCompleteListener, EventChannel.StreamHandler { 91 | 92 | private String TAG = JWEventHandler.class.getName(); 93 | 94 | private EventChannel.EventSink eventSink; 95 | 96 | public JWEventHandler(JWPlayerView jwPlayerView) { 97 | // Subscribe to all JW Player events 98 | jwPlayerView.addOnReadyListener(this); 99 | jwPlayerView.addOnFirstFrameListener(this); 100 | jwPlayerView.addOnSetupErrorListener(this); 101 | jwPlayerView.addOnPlaylistListener(this); 102 | jwPlayerView.addOnPlaylistItemListener(this); 103 | jwPlayerView.addOnPlayListener(this); 104 | jwPlayerView.addOnPauseListener(this); 105 | jwPlayerView.addOnBufferListener(this); 106 | jwPlayerView.addOnIdleListener(this); 107 | jwPlayerView.addOnErrorListener(this); 108 | jwPlayerView.addOnSeekListener(this); 109 | jwPlayerView.addOnTimeListener(this); 110 | jwPlayerView.addOnFullscreenListener(this); 111 | jwPlayerView.addOnLevelsChangedListener(this); 112 | jwPlayerView.addOnLevelsListener(this); 113 | jwPlayerView.addOnCaptionsListListener(this); 114 | jwPlayerView.addOnCaptionsChangedListener(this); 115 | // jwPlayerView.addOnRelatedCloseListener(this); 116 | // jwPlayerView.addOnRelatedOpenListener(this); 117 | // jwPlayerView.addOnRelatedPlayListener(this); 118 | jwPlayerView.addOnControlsListener(this); 119 | jwPlayerView.addOnControlBarVisibilityListener(this); 120 | jwPlayerView.addOnDisplayClickListener(this); 121 | jwPlayerView.addOnMuteListener(this); 122 | jwPlayerView.addOnVisualQualityListener(this); 123 | jwPlayerView.addOnSeekedListener(this); 124 | jwPlayerView.addOnAdClickListener(this); 125 | jwPlayerView.addOnAdCompleteListener(this); 126 | jwPlayerView.addOnAdSkippedListener(this); 127 | jwPlayerView.addOnAdErrorListener(this); 128 | jwPlayerView.addOnAdImpressionListener(this); 129 | jwPlayerView.addOnAdTimeListener(this); 130 | jwPlayerView.addOnAdPauseListener(this); 131 | jwPlayerView.addOnAdPlayListener(this); 132 | jwPlayerView.addOnMetaListener(this); 133 | jwPlayerView.addOnPlaylistCompleteListener(this); 134 | jwPlayerView.addOnCompleteListener(this); 135 | jwPlayerView.addOnBeforePlayListener(this); 136 | jwPlayerView.addOnBeforeCompleteListener(this); 137 | jwPlayerView.addOnAdScheduleListener(this); 138 | } 139 | 140 | @Override 141 | public void onListen(Object o, EventChannel.EventSink eventSink) { 142 | this.eventSink = eventSink; 143 | } 144 | 145 | @Override 146 | public void onCancel(Object o) { 147 | this.eventSink = null; 148 | } 149 | 150 | @Override 151 | public void onAdClick(AdClickEvent adClickEvent) { 152 | Log.d(TAG, "onAdClick"); 153 | 154 | try { 155 | 156 | JSONObject message = new JSONObject(); 157 | 158 | message.put("name", "onAdClick"); 159 | 160 | eventSink.success(message); 161 | 162 | } catch (Exception e) { /* ignore */ } 163 | } 164 | 165 | @Override 166 | public void onAdComplete(AdCompleteEvent adCompleteEvent) { 167 | Log.d(TAG, "onAdComplete"); 168 | 169 | try { 170 | 171 | JSONObject message = new JSONObject(); 172 | 173 | message.put("name", "onAdComplete"); 174 | 175 | eventSink.success(message); 176 | 177 | } catch (Exception e) { /* ignore */ } 178 | } 179 | 180 | @Override 181 | public void onAdError(AdErrorEvent adErrorEvent) { 182 | Log.d(TAG, "onAdError"); 183 | 184 | try { 185 | 186 | JSONObject message = new JSONObject(); 187 | 188 | message.put("name", "onAdError"); 189 | 190 | eventSink.success(message); 191 | 192 | } catch (Exception e) { /* ignore */ } 193 | } 194 | 195 | @Override 196 | public void onAdImpression(AdImpressionEvent adImpressionEvent) { 197 | Log.d(TAG, "onAdImpression"); 198 | 199 | try { 200 | 201 | JSONObject message = new JSONObject(); 202 | 203 | message.put("name", "onAdImpression"); 204 | 205 | eventSink.success(message); 206 | 207 | } catch (Exception e) { /* ignore */ } 208 | } 209 | 210 | @Override 211 | public void onAdPause(AdPauseEvent adPauseEvent) { 212 | Log.d(TAG, "onAdPause"); 213 | 214 | try { 215 | 216 | JSONObject message = new JSONObject(); 217 | 218 | message.put("name", "onAdPause"); 219 | 220 | eventSink.success(message); 221 | 222 | } catch (Exception e) { /* ignore */ } 223 | } 224 | 225 | @Override 226 | public void onAdPlay(AdPlayEvent adPlayEvent) { 227 | Log.d(TAG, "onAdPlay"); 228 | 229 | try { 230 | 231 | JSONObject message = new JSONObject(); 232 | 233 | message.put("name", "onAdPlay"); 234 | 235 | eventSink.success(message); 236 | 237 | } catch (Exception e) { /* ignore */ } 238 | } 239 | 240 | @Override 241 | public void onAdSchedule(AdScheduleEvent adScheduleEvent) { 242 | Log.d(TAG, "onAdSchedule"); 243 | 244 | try { 245 | 246 | JSONObject message = new JSONObject(); 247 | 248 | message.put("name", "onAdSchedule"); 249 | 250 | eventSink.success(message); 251 | 252 | } catch (Exception e) { /* ignore */ } 253 | } 254 | 255 | @Override 256 | public void onAdSkipped(AdSkippedEvent adSkippedEvent) { 257 | Log.d(TAG, "onAdSkipped"); 258 | 259 | try { 260 | 261 | JSONObject message = new JSONObject(); 262 | 263 | message.put("name", "onAdSkipped"); 264 | 265 | eventSink.success(message); 266 | 267 | } catch (Exception e) { /* ignore */ } 268 | } 269 | 270 | @Override 271 | public void onAdTime(AdTimeEvent adTimeEvent) { 272 | Log.d(TAG, "onAdTime"); 273 | 274 | try { 275 | 276 | JSONObject message = new JSONObject(); 277 | 278 | message.put("name", "onAdTime"); 279 | 280 | eventSink.success(message); 281 | 282 | } catch (Exception e) { /* ignore */ } 283 | } 284 | 285 | @Override 286 | public void onBeforeComplete(BeforeCompleteEvent beforeCompleteEvent) { 287 | Log.d(TAG, "onBeforeComplete"); 288 | 289 | try { 290 | 291 | JSONObject message = new JSONObject(); 292 | 293 | message.put("name", "onBeforeComplete"); 294 | 295 | eventSink.success(message); 296 | 297 | } catch (Exception e) { /* ignore */ } 298 | } 299 | 300 | @Override 301 | public void onBeforePlay(BeforePlayEvent beforePlayEvent) { 302 | Log.d(TAG, "onBeforePlay"); 303 | 304 | try { 305 | 306 | JSONObject message = new JSONObject(); 307 | 308 | message.put("name", "onBeforePlay"); 309 | 310 | eventSink.success(message); 311 | 312 | } catch (Exception e) { /* ignore */ } 313 | } 314 | 315 | @Override 316 | public void onAudioTrackChanged(AudioTrackChangedEvent audioTrackChangedEvent) { 317 | Log.d(TAG, "onAudioTrackChanged"); 318 | 319 | try { 320 | 321 | JSONObject message = new JSONObject(); 322 | 323 | message.put("name", "onAudioTrackChanged"); 324 | 325 | eventSink.success(message); 326 | 327 | } catch (Exception e) { /* ignore */ } 328 | } 329 | 330 | @Override 331 | public void onAudioTracks(AudioTracksEvent audioTracksEvent) { 332 | Log.d(TAG, "onAudioTracks"); 333 | 334 | try { 335 | 336 | JSONObject message = new JSONObject(); 337 | 338 | message.put("name", "onAudioTracks"); 339 | 340 | eventSink.success(message); 341 | 342 | } catch (Exception e) { /* ignore */ } 343 | } 344 | 345 | @Override 346 | public void onBuffer(BufferEvent bufferEvent) { 347 | Log.d(TAG, "onBuffer"); 348 | 349 | try { 350 | 351 | JSONObject message = new JSONObject(); 352 | 353 | message.put("name", "onBuffer"); 354 | 355 | message.put("oldState", bufferEvent.getOldState()); 356 | 357 | eventSink.success(message); 358 | 359 | } catch (Exception e) { /* ignore */ } 360 | } 361 | 362 | @Override 363 | public void onCaptionsChanged(CaptionsChangedEvent captionsChangedEvent) { 364 | Log.d(TAG, "onCaptionsChanged"); 365 | 366 | try { 367 | 368 | JSONObject message = new JSONObject(); 369 | 370 | message.put("name", "onCaptionsChanged"); 371 | 372 | message.put("currentTrack", captionsChangedEvent.getCurrentTrack()); 373 | 374 | eventSink.success(message); 375 | 376 | } catch (Exception e) { /* ignore */ } 377 | } 378 | 379 | @Override 380 | public void onCaptionsList(CaptionsListEvent captionsListEvent) { 381 | Log.d(TAG, "onCaptionsList"); 382 | 383 | try { 384 | 385 | JSONObject message = new JSONObject(); 386 | 387 | message.put("name", "onCaptionsList"); 388 | 389 | eventSink.success(message); 390 | 391 | } catch (Exception e) { /* ignore */ } 392 | } 393 | 394 | @Override 395 | public void onComplete(CompleteEvent completeEvent) { 396 | Log.d(TAG, "onComplete"); 397 | 398 | try { 399 | 400 | JSONObject message = new JSONObject(); 401 | 402 | message.put("name", "onComplete"); 403 | 404 | eventSink.success(message); 405 | 406 | } catch (Exception e) { /* ignore */ } 407 | } 408 | 409 | @Override 410 | public void onControlBarVisibilityChanged(ControlBarVisibilityEvent controlBarVisibilityEvent) { 411 | Log.d(TAG, "onControlBarVisibilityChanged"); 412 | 413 | try { 414 | 415 | JSONObject message = new JSONObject(); 416 | 417 | message.put("name", "onControlBarVisibilityChanged"); 418 | 419 | message.put("controls", controlBarVisibilityEvent.isVisible()); 420 | 421 | eventSink.success(message); 422 | 423 | } catch (Exception e) { /* ignore */ } 424 | } 425 | 426 | @Override 427 | public void onControls(ControlsEvent controlsEvent) { 428 | Log.d(TAG, "onControls"); 429 | 430 | try { 431 | 432 | JSONObject message = new JSONObject(); 433 | 434 | message.put("name", "onControls"); 435 | 436 | message.put("controls", controlsEvent.getControls()); 437 | 438 | eventSink.success(message); 439 | 440 | } catch (Exception e) { /* ignore */ } 441 | } 442 | 443 | @Override 444 | public void onDisplayClick(DisplayClickEvent displayClickEvent) { 445 | Log.d(TAG, "onDisplayClick"); 446 | 447 | try { 448 | 449 | JSONObject message = new JSONObject(); 450 | 451 | message.put("name", "onDisplayClick"); 452 | 453 | eventSink.success(message); 454 | 455 | } catch (Exception e) { /* ignore */ } 456 | } 457 | 458 | @Override 459 | public void onError(ErrorEvent errorEvent) { 460 | Log.d(TAG, "onError"); 461 | 462 | try { 463 | 464 | JSONObject message = new JSONObject(); 465 | 466 | message.put("name", "onError"); 467 | 468 | message.put("message", errorEvent.getMessage()); 469 | 470 | eventSink.success(message); 471 | 472 | } catch (Exception e) { /* ignore */ } 473 | } 474 | 475 | @Override 476 | public void onFirstFrame(FirstFrameEvent firstFrameEvent) { 477 | Log.d(TAG, "onFirstFrame"); 478 | 479 | try { 480 | 481 | JSONObject message = new JSONObject(); 482 | 483 | message.put("name", "onFirstFrame"); 484 | 485 | message.put("loadTime", firstFrameEvent.getLoadTime()); 486 | 487 | eventSink.success(message); 488 | 489 | } catch (Exception e) { /* ignore */ } 490 | } 491 | 492 | @Override 493 | public void onFullscreen(FullscreenEvent fullscreenEvent) { 494 | Log.d(TAG, "onFullscreen"); 495 | 496 | try { 497 | 498 | JSONObject message = new JSONObject(); 499 | 500 | message.put("name", "onFullscreen"); 501 | 502 | message.put("fullscreen", fullscreenEvent.getFullscreen()); 503 | 504 | eventSink.success(message); 505 | 506 | } catch (Exception e) { /* ignore */ } 507 | } 508 | 509 | @Override 510 | public void onIdle(IdleEvent idleEvent) { 511 | Log.d(TAG, "onIdle"); 512 | 513 | try { 514 | 515 | JSONObject message = new JSONObject(); 516 | 517 | message.put("name", "onIdle"); 518 | 519 | eventSink.success(message); 520 | 521 | } catch (Exception e) { /* ignore */ } 522 | } 523 | 524 | @Override 525 | public void onLevelsChanged(LevelsChangedEvent levelsChangedEvent) { 526 | Log.d(TAG, "onLevelsChanged"); 527 | 528 | try { 529 | 530 | JSONObject message = new JSONObject(); 531 | 532 | message.put("name", "onLevelsChanged"); 533 | 534 | eventSink.success(message); 535 | 536 | } catch (Exception e) { /* ignore */ } 537 | } 538 | 539 | @Override 540 | public void onLevels(LevelsEvent levelsEvent) { 541 | Log.d(TAG, "onLevels"); 542 | 543 | try { 544 | 545 | JSONObject message = new JSONObject(); 546 | 547 | message.put("name", "onLevels"); 548 | 549 | eventSink.success(message); 550 | 551 | } catch (Exception e) { /* ignore */ } 552 | } 553 | 554 | @Override 555 | public void onMeta(MetaEvent metaEvent) { 556 | Log.d(TAG, "onMeta"); 557 | 558 | try { 559 | 560 | JSONObject message = new JSONObject(); 561 | 562 | message.put("name", "onMeta"); 563 | 564 | eventSink.success(message); 565 | 566 | } catch (Exception e) { /* ignore */ } 567 | } 568 | 569 | @Override 570 | public void onMute(MuteEvent muteEvent) { 571 | Log.d(TAG, "onMute"); 572 | 573 | try { 574 | 575 | JSONObject message = new JSONObject(); 576 | 577 | message.put("name", "onMute"); 578 | 579 | message.put("mute", muteEvent.getMute()); 580 | 581 | eventSink.success(message); 582 | 583 | } catch (Exception e) { /* ignore */ } 584 | } 585 | 586 | @Override 587 | public void onPause(PauseEvent pauseEvent) { 588 | Log.d(TAG, "onPause"); 589 | 590 | try { 591 | 592 | JSONObject message = new JSONObject(); 593 | 594 | message.put("name", "onPause"); 595 | 596 | message.put("oldState", pauseEvent.getOldState()); 597 | 598 | eventSink.success(message); 599 | 600 | } catch (Exception e) { /* ignore */ } 601 | } 602 | 603 | @Override 604 | public void onPlay(PlayEvent playEvent) { 605 | Log.d(TAG, "onPlay"); 606 | 607 | try { 608 | 609 | JSONObject message = new JSONObject(); 610 | 611 | message.put("name", "onPlay"); 612 | 613 | message.put("oldState", playEvent.getOldState()); 614 | 615 | eventSink.success(message); 616 | 617 | } catch (Exception e) { /* ignore */ } 618 | } 619 | 620 | @Override 621 | public void onPlaylistComplete(PlaylistCompleteEvent playlistCompleteEvent) { 622 | Log.d(TAG, "onPlaylistComplete"); 623 | 624 | try { 625 | 626 | JSONObject message = new JSONObject(); 627 | 628 | message.put("name", "onPlaylistComplete"); 629 | 630 | eventSink.success(message); 631 | 632 | } catch (Exception e) { /* ignore */ } 633 | } 634 | 635 | @Override 636 | public void onPlaylistItem(PlaylistItemEvent playlistItemEvent) { 637 | Log.d(TAG, "onPlaylistItem"); 638 | 639 | try { 640 | 641 | JSONObject message = new JSONObject(); 642 | 643 | message.put("name", "onPlaylistItem"); 644 | 645 | eventSink.success(message); 646 | 647 | } catch (Exception e) { /* ignore */ } 648 | } 649 | 650 | @Override 651 | public void onPlaylist(PlaylistEvent playlistEvent) { 652 | Log.d(TAG, "onPlaylist"); 653 | 654 | try { 655 | 656 | JSONObject message = new JSONObject(); 657 | 658 | message.put("name", "onPlaylist"); 659 | 660 | eventSink.success(message); 661 | 662 | } catch (Exception e) { /* ignore */ } 663 | } 664 | 665 | @Override 666 | public void onReady(ReadyEvent readyEvent) { 667 | Log.d(TAG, "onReady"); 668 | 669 | try { 670 | 671 | JSONObject message = new JSONObject(); 672 | 673 | message.put("name", "onReady"); 674 | 675 | message.put("setupTime", readyEvent.getSetupTime()); 676 | 677 | eventSink.success(message); 678 | 679 | } catch (Exception e) { /* ignore */ } 680 | } 681 | 682 | @Override 683 | public void onSeek(SeekEvent seekEvent) { 684 | Log.d(TAG, "onSeek"); 685 | 686 | try { 687 | 688 | JSONObject message = new JSONObject(); 689 | 690 | message.put("name", "onSeek"); 691 | 692 | message.put("offset", seekEvent.getOffset()); 693 | 694 | message.put("position", seekEvent.getPosition()); 695 | 696 | eventSink.success(message); 697 | 698 | } catch (Exception e) { /* ignore */ } 699 | } 700 | 701 | @Override 702 | public void onSeeked(SeekedEvent seekedEvent) { 703 | Log.d(TAG, "onSeeked"); 704 | 705 | try { 706 | 707 | JSONObject message = new JSONObject(); 708 | 709 | message.put("name", "onSeeked"); 710 | 711 | message.put("position", seekedEvent.getPosition()); 712 | 713 | eventSink.success(message); 714 | 715 | } catch (Exception e) { /* ignore */ } 716 | } 717 | 718 | @Override 719 | public void onSetupError(SetupErrorEvent setupErrorEvent) { 720 | Log.d(TAG, "onSetupError"); 721 | 722 | try { 723 | 724 | JSONObject message = new JSONObject(); 725 | 726 | message.put("name", "onSetupError"); 727 | 728 | message.put("message", setupErrorEvent.getMessage()); 729 | 730 | eventSink.success(message); 731 | 732 | } catch (Exception e) { /* ignore */ } 733 | } 734 | 735 | @Override 736 | public void onTime(TimeEvent timeEvent) { 737 | Log.d(TAG, "onTime"); 738 | 739 | try { 740 | 741 | JSONObject message = new JSONObject(); 742 | 743 | message.put("name", "onTime"); 744 | 745 | message.put("duration", timeEvent.getDuration()); 746 | 747 | message.put("position", timeEvent.getPosition()); 748 | 749 | eventSink.success(message); 750 | 751 | } catch (Exception e) { /* ignore */ } 752 | } 753 | 754 | @Override 755 | public void onVisualQuality(VisualQualityEvent visualQualityEvent) { 756 | Log.d(TAG, "onVisualQuality"); 757 | 758 | try { 759 | 760 | JSONObject message = new JSONObject(); 761 | 762 | message.put("name", "onVisualQuality"); 763 | 764 | eventSink.success(message); 765 | 766 | } catch (Exception e) { /* ignore */ } 767 | } 768 | } -------------------------------------------------------------------------------- /ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 2A8EB0C22296B05400463A02 /* PlayerViewFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A8EB0C12296B05400463A02 /* PlayerViewFactory.swift */; }; 12 | 2A8EB0C62296B08800463A02 /* PlayerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A8EB0C52296B08800463A02 /* PlayerView.swift */; }; 13 | 2A8EB0C82296B0C200463A02 /* PlayerObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A8EB0C72296B0C200463A02 /* PlayerObserver.swift */; }; 14 | 2A8EB0CA2296B0D800463A02 /* PlayerDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A8EB0C92296B0D800463A02 /* PlayerDelegate.swift */; }; 15 | 2A8EB0D72296B3FB00463A02 /* JWPlayer_iOS_SDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A8EB0D62296B3FB00463A02 /* JWPlayer_iOS_SDK.framework */; }; 16 | 2A8EB0D82296B40400463A02 /* JWPlayer_iOS_SDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2A8EB0D62296B3FB00463A02 /* JWPlayer_iOS_SDK.framework */; }; 17 | 2A8EB0D92296B40400463A02 /* JWPlayer_iOS_SDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 2A8EB0D62296B3FB00463A02 /* JWPlayer_iOS_SDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 18 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 19 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 20 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 21 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 22 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 23 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 24 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */ = {isa = PBXBuildFile; fileRef = 9740EEB21CF90195004384FC /* Debug.xcconfig */; }; 25 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 26 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 27 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 28 | /* End PBXBuildFile section */ 29 | 30 | /* Begin PBXCopyFilesBuildPhase section */ 31 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 32 | isa = PBXCopyFilesBuildPhase; 33 | buildActionMask = 2147483647; 34 | dstPath = ""; 35 | dstSubfolderSpec = 10; 36 | files = ( 37 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 38 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 39 | 2A8EB0D92296B40400463A02 /* JWPlayer_iOS_SDK.framework in Embed Frameworks */, 40 | ); 41 | name = "Embed Frameworks"; 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | /* End PBXCopyFilesBuildPhase section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 48 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 49 | 2A8EB0C12296B05400463A02 /* PlayerViewFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerViewFactory.swift; sourceTree = ""; }; 50 | 2A8EB0C52296B08800463A02 /* PlayerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerView.swift; sourceTree = ""; }; 51 | 2A8EB0C72296B0C200463A02 /* PlayerObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerObserver.swift; sourceTree = ""; }; 52 | 2A8EB0C92296B0D800463A02 /* PlayerDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayerDelegate.swift; sourceTree = ""; }; 53 | 2A8EB0D22296B37F00463A02 /* JWPlayer_iOS_SDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JWPlayer_iOS_SDK.framework; path = ../../ios_frameworks/jwplayer/3.5.0/JWPlayer_iOS_SDK.framework; sourceTree = ""; }; 54 | 2A8EB0D62296B3FB00463A02 /* JWPlayer_iOS_SDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JWPlayer_iOS_SDK.framework; sourceTree = ""; }; 55 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 56 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 57 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 58 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 59 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 60 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 61 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 62 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 63 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 65 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 66 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 67 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 68 | /* End PBXFileReference section */ 69 | 70 | /* Begin PBXFrameworksBuildPhase section */ 71 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 72 | isa = PBXFrameworksBuildPhase; 73 | buildActionMask = 2147483647; 74 | files = ( 75 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 76 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 77 | 2A8EB0D72296B3FB00463A02 /* JWPlayer_iOS_SDK.framework in Frameworks */, 78 | 2A8EB0D82296B40400463A02 /* JWPlayer_iOS_SDK.framework in Frameworks */, 79 | ); 80 | runOnlyForDeploymentPostprocessing = 0; 81 | }; 82 | /* End PBXFrameworksBuildPhase section */ 83 | 84 | /* Begin PBXGroup section */ 85 | 2A8EB0C02296B04200463A02 /* jwplayer */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 2A8EB0C12296B05400463A02 /* PlayerViewFactory.swift */, 89 | 2A8EB0C52296B08800463A02 /* PlayerView.swift */, 90 | 2A8EB0C72296B0C200463A02 /* PlayerObserver.swift */, 91 | 2A8EB0C92296B0D800463A02 /* PlayerDelegate.swift */, 92 | ); 93 | path = jwplayer; 94 | sourceTree = ""; 95 | }; 96 | 2A8EB0CE2296B34900463A02 /* Frameworks */ = { 97 | isa = PBXGroup; 98 | children = ( 99 | 2A8EB0D22296B37F00463A02 /* JWPlayer_iOS_SDK.framework */, 100 | ); 101 | name = Frameworks; 102 | sourceTree = ""; 103 | }; 104 | 9740EEB11CF90186004384FC /* Flutter */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 3B80C3931E831B6300D905FE /* App.framework */, 108 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 109 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 110 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 111 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 112 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 113 | ); 114 | name = Flutter; 115 | sourceTree = ""; 116 | }; 117 | 97C146E51CF9000F007C117D = { 118 | isa = PBXGroup; 119 | children = ( 120 | 2A8EB0D62296B3FB00463A02 /* JWPlayer_iOS_SDK.framework */, 121 | 9740EEB11CF90186004384FC /* Flutter */, 122 | 97C146F01CF9000F007C117D /* Runner */, 123 | 97C146EF1CF9000F007C117D /* Products */, 124 | 2A8EB0CE2296B34900463A02 /* Frameworks */, 125 | ); 126 | sourceTree = ""; 127 | }; 128 | 97C146EF1CF9000F007C117D /* Products */ = { 129 | isa = PBXGroup; 130 | children = ( 131 | 97C146EE1CF9000F007C117D /* Runner.app */, 132 | ); 133 | name = Products; 134 | sourceTree = ""; 135 | }; 136 | 97C146F01CF9000F007C117D /* Runner */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | 2A8EB0C02296B04200463A02 /* jwplayer */, 140 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 141 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 142 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 143 | 97C147021CF9000F007C117D /* Info.plist */, 144 | 97C146F11CF9000F007C117D /* Supporting Files */, 145 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 146 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 147 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 148 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 149 | ); 150 | path = Runner; 151 | sourceTree = ""; 152 | }; 153 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 154 | isa = PBXGroup; 155 | children = ( 156 | ); 157 | name = "Supporting Files"; 158 | sourceTree = ""; 159 | }; 160 | /* End PBXGroup section */ 161 | 162 | /* Begin PBXNativeTarget section */ 163 | 97C146ED1CF9000F007C117D /* Runner */ = { 164 | isa = PBXNativeTarget; 165 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 166 | buildPhases = ( 167 | 9740EEB61CF901F6004384FC /* Run Script */, 168 | 97C146EA1CF9000F007C117D /* Sources */, 169 | 97C146EB1CF9000F007C117D /* Frameworks */, 170 | 97C146EC1CF9000F007C117D /* Resources */, 171 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 172 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 173 | ); 174 | buildRules = ( 175 | ); 176 | dependencies = ( 177 | ); 178 | name = Runner; 179 | productName = Runner; 180 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 181 | productType = "com.apple.product-type.application"; 182 | }; 183 | /* End PBXNativeTarget section */ 184 | 185 | /* Begin PBXProject section */ 186 | 97C146E61CF9000F007C117D /* Project object */ = { 187 | isa = PBXProject; 188 | attributes = { 189 | LastUpgradeCheck = 0910; 190 | ORGANIZATIONNAME = "The Chromium Authors"; 191 | TargetAttributes = { 192 | 97C146ED1CF9000F007C117D = { 193 | CreatedOnToolsVersion = 7.3.1; 194 | LastSwiftMigration = 0910; 195 | }; 196 | }; 197 | }; 198 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 199 | compatibilityVersion = "Xcode 3.2"; 200 | developmentRegion = English; 201 | hasScannedForEncodings = 0; 202 | knownRegions = ( 203 | English, 204 | en, 205 | Base, 206 | ); 207 | mainGroup = 97C146E51CF9000F007C117D; 208 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 209 | projectDirPath = ""; 210 | projectRoot = ""; 211 | targets = ( 212 | 97C146ED1CF9000F007C117D /* Runner */, 213 | ); 214 | }; 215 | /* End PBXProject section */ 216 | 217 | /* Begin PBXResourcesBuildPhase section */ 218 | 97C146EC1CF9000F007C117D /* Resources */ = { 219 | isa = PBXResourcesBuildPhase; 220 | buildActionMask = 2147483647; 221 | files = ( 222 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 223 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 224 | 9740EEB41CF90195004384FC /* Debug.xcconfig in Resources */, 225 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 226 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 227 | ); 228 | runOnlyForDeploymentPostprocessing = 0; 229 | }; 230 | /* End PBXResourcesBuildPhase section */ 231 | 232 | /* Begin PBXShellScriptBuildPhase section */ 233 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 234 | isa = PBXShellScriptBuildPhase; 235 | buildActionMask = 2147483647; 236 | files = ( 237 | ); 238 | inputPaths = ( 239 | ); 240 | name = "Thin Binary"; 241 | outputPaths = ( 242 | ); 243 | runOnlyForDeploymentPostprocessing = 0; 244 | shellPath = /bin/sh; 245 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 246 | }; 247 | 9740EEB61CF901F6004384FC /* Run Script */ = { 248 | isa = PBXShellScriptBuildPhase; 249 | buildActionMask = 2147483647; 250 | files = ( 251 | ); 252 | inputPaths = ( 253 | ); 254 | name = "Run Script"; 255 | outputPaths = ( 256 | ); 257 | runOnlyForDeploymentPostprocessing = 0; 258 | shellPath = /bin/sh; 259 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 260 | }; 261 | /* End PBXShellScriptBuildPhase section */ 262 | 263 | /* Begin PBXSourcesBuildPhase section */ 264 | 97C146EA1CF9000F007C117D /* Sources */ = { 265 | isa = PBXSourcesBuildPhase; 266 | buildActionMask = 2147483647; 267 | files = ( 268 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 269 | 2A8EB0C82296B0C200463A02 /* PlayerObserver.swift in Sources */, 270 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 271 | 2A8EB0C22296B05400463A02 /* PlayerViewFactory.swift in Sources */, 272 | 2A8EB0C62296B08800463A02 /* PlayerView.swift in Sources */, 273 | 2A8EB0CA2296B0D800463A02 /* PlayerDelegate.swift in Sources */, 274 | ); 275 | runOnlyForDeploymentPostprocessing = 0; 276 | }; 277 | /* End PBXSourcesBuildPhase section */ 278 | 279 | /* Begin PBXVariantGroup section */ 280 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 281 | isa = PBXVariantGroup; 282 | children = ( 283 | 97C146FB1CF9000F007C117D /* Base */, 284 | ); 285 | name = Main.storyboard; 286 | sourceTree = ""; 287 | }; 288 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 289 | isa = PBXVariantGroup; 290 | children = ( 291 | 97C147001CF9000F007C117D /* Base */, 292 | ); 293 | name = LaunchScreen.storyboard; 294 | sourceTree = ""; 295 | }; 296 | /* End PBXVariantGroup section */ 297 | 298 | /* Begin XCBuildConfiguration section */ 299 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 300 | isa = XCBuildConfiguration; 301 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 302 | buildSettings = { 303 | ALWAYS_SEARCH_USER_PATHS = NO; 304 | CLANG_ANALYZER_NONNULL = YES; 305 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 306 | CLANG_CXX_LIBRARY = "libc++"; 307 | CLANG_ENABLE_MODULES = YES; 308 | CLANG_ENABLE_OBJC_ARC = YES; 309 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 310 | CLANG_WARN_BOOL_CONVERSION = YES; 311 | CLANG_WARN_COMMA = YES; 312 | CLANG_WARN_CONSTANT_CONVERSION = YES; 313 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 314 | CLANG_WARN_EMPTY_BODY = YES; 315 | CLANG_WARN_ENUM_CONVERSION = YES; 316 | CLANG_WARN_INFINITE_RECURSION = YES; 317 | CLANG_WARN_INT_CONVERSION = YES; 318 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 319 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 320 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 321 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 322 | CLANG_WARN_STRICT_PROTOTYPES = YES; 323 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 324 | CLANG_WARN_UNREACHABLE_CODE = YES; 325 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 326 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 327 | COPY_PHASE_STRIP = NO; 328 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 329 | ENABLE_NS_ASSERTIONS = NO; 330 | ENABLE_STRICT_OBJC_MSGSEND = YES; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_NO_COMMON_BLOCKS = YES; 333 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 334 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 335 | GCC_WARN_UNDECLARED_SELECTOR = YES; 336 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 337 | GCC_WARN_UNUSED_FUNCTION = YES; 338 | GCC_WARN_UNUSED_VARIABLE = YES; 339 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 340 | MTL_ENABLE_DEBUG_INFO = NO; 341 | SDKROOT = iphoneos; 342 | TARGETED_DEVICE_FAMILY = "1,2"; 343 | VALIDATE_PRODUCT = YES; 344 | }; 345 | name = Profile; 346 | }; 347 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 348 | isa = XCBuildConfiguration; 349 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 350 | buildSettings = { 351 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 352 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 353 | DEVELOPMENT_TEAM = S8QB4VV633; 354 | ENABLE_BITCODE = NO; 355 | FRAMEWORK_SEARCH_PATHS = ( 356 | "$(inherited)", 357 | "$(PROJECT_DIR)/Flutter", 358 | "$(PROJECT_DIR)", 359 | ); 360 | INFOPLIST_FILE = Runner/Info.plist; 361 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 362 | LIBRARY_SEARCH_PATHS = ( 363 | "$(inherited)", 364 | "$(PROJECT_DIR)/Flutter", 365 | ); 366 | PRODUCT_BUNDLE_IDENTIFIER = tv.mta.jwplayer.jwplayerFlutter; 367 | PRODUCT_NAME = "$(TARGET_NAME)"; 368 | SWIFT_VERSION = 4.0; 369 | VERSIONING_SYSTEM = "apple-generic"; 370 | }; 371 | name = Profile; 372 | }; 373 | 97C147031CF9000F007C117D /* Debug */ = { 374 | isa = XCBuildConfiguration; 375 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 376 | buildSettings = { 377 | ALWAYS_SEARCH_USER_PATHS = NO; 378 | CLANG_ANALYZER_NONNULL = YES; 379 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 380 | CLANG_CXX_LIBRARY = "libc++"; 381 | CLANG_ENABLE_MODULES = YES; 382 | CLANG_ENABLE_OBJC_ARC = YES; 383 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 384 | CLANG_WARN_BOOL_CONVERSION = YES; 385 | CLANG_WARN_COMMA = YES; 386 | CLANG_WARN_CONSTANT_CONVERSION = YES; 387 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 388 | CLANG_WARN_EMPTY_BODY = YES; 389 | CLANG_WARN_ENUM_CONVERSION = YES; 390 | CLANG_WARN_INFINITE_RECURSION = YES; 391 | CLANG_WARN_INT_CONVERSION = YES; 392 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 393 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 395 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 396 | CLANG_WARN_STRICT_PROTOTYPES = YES; 397 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 398 | CLANG_WARN_UNREACHABLE_CODE = YES; 399 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 400 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 401 | COPY_PHASE_STRIP = NO; 402 | DEBUG_INFORMATION_FORMAT = dwarf; 403 | ENABLE_STRICT_OBJC_MSGSEND = YES; 404 | ENABLE_TESTABILITY = YES; 405 | GCC_C_LANGUAGE_STANDARD = gnu99; 406 | GCC_DYNAMIC_NO_PIC = NO; 407 | GCC_NO_COMMON_BLOCKS = YES; 408 | GCC_OPTIMIZATION_LEVEL = 0; 409 | GCC_PREPROCESSOR_DEFINITIONS = ( 410 | "DEBUG=1", 411 | "$(inherited)", 412 | ); 413 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 414 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 415 | GCC_WARN_UNDECLARED_SELECTOR = YES; 416 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 417 | GCC_WARN_UNUSED_FUNCTION = YES; 418 | GCC_WARN_UNUSED_VARIABLE = YES; 419 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 420 | MTL_ENABLE_DEBUG_INFO = YES; 421 | ONLY_ACTIVE_ARCH = YES; 422 | SDKROOT = iphoneos; 423 | TARGETED_DEVICE_FAMILY = "1,2"; 424 | }; 425 | name = Debug; 426 | }; 427 | 97C147041CF9000F007C117D /* Release */ = { 428 | isa = XCBuildConfiguration; 429 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | CLANG_ANALYZER_NONNULL = YES; 433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 434 | CLANG_CXX_LIBRARY = "libc++"; 435 | CLANG_ENABLE_MODULES = YES; 436 | CLANG_ENABLE_OBJC_ARC = YES; 437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 438 | CLANG_WARN_BOOL_CONVERSION = YES; 439 | CLANG_WARN_COMMA = YES; 440 | CLANG_WARN_CONSTANT_CONVERSION = YES; 441 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 442 | CLANG_WARN_EMPTY_BODY = YES; 443 | CLANG_WARN_ENUM_CONVERSION = YES; 444 | CLANG_WARN_INFINITE_RECURSION = YES; 445 | CLANG_WARN_INT_CONVERSION = YES; 446 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 447 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 448 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 449 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 450 | CLANG_WARN_STRICT_PROTOTYPES = YES; 451 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 452 | CLANG_WARN_UNREACHABLE_CODE = YES; 453 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 454 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 455 | COPY_PHASE_STRIP = NO; 456 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 457 | ENABLE_NS_ASSERTIONS = NO; 458 | ENABLE_STRICT_OBJC_MSGSEND = YES; 459 | GCC_C_LANGUAGE_STANDARD = gnu99; 460 | GCC_NO_COMMON_BLOCKS = YES; 461 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 462 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 463 | GCC_WARN_UNDECLARED_SELECTOR = YES; 464 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 465 | GCC_WARN_UNUSED_FUNCTION = YES; 466 | GCC_WARN_UNUSED_VARIABLE = YES; 467 | IPHONEOS_DEPLOYMENT_TARGET = 10.0; 468 | MTL_ENABLE_DEBUG_INFO = NO; 469 | SDKROOT = iphoneos; 470 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 471 | TARGETED_DEVICE_FAMILY = "1,2"; 472 | VALIDATE_PRODUCT = YES; 473 | }; 474 | name = Release; 475 | }; 476 | 97C147061CF9000F007C117D /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 479 | buildSettings = { 480 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 481 | CLANG_ENABLE_MODULES = YES; 482 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 483 | ENABLE_BITCODE = NO; 484 | FRAMEWORK_SEARCH_PATHS = ( 485 | "$(inherited)", 486 | "$(PROJECT_DIR)/Flutter", 487 | "$(PROJECT_DIR)", 488 | ); 489 | INFOPLIST_FILE = Runner/Info.plist; 490 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 491 | LIBRARY_SEARCH_PATHS = ( 492 | "$(inherited)", 493 | "$(PROJECT_DIR)/Flutter", 494 | ); 495 | PRODUCT_BUNDLE_IDENTIFIER = tv.mta.jwplayer.jwplayerFlutter; 496 | PRODUCT_NAME = "$(TARGET_NAME)"; 497 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 498 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 499 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 500 | SWIFT_VERSION = 4.0; 501 | VERSIONING_SYSTEM = "apple-generic"; 502 | }; 503 | name = Debug; 504 | }; 505 | 97C147071CF9000F007C117D /* Release */ = { 506 | isa = XCBuildConfiguration; 507 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 508 | buildSettings = { 509 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 510 | CLANG_ENABLE_MODULES = YES; 511 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 512 | ENABLE_BITCODE = NO; 513 | FRAMEWORK_SEARCH_PATHS = ( 514 | "$(inherited)", 515 | "$(PROJECT_DIR)/Flutter", 516 | "$(PROJECT_DIR)", 517 | ); 518 | INFOPLIST_FILE = Runner/Info.plist; 519 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 520 | LIBRARY_SEARCH_PATHS = ( 521 | "$(inherited)", 522 | "$(PROJECT_DIR)/Flutter", 523 | ); 524 | PRODUCT_BUNDLE_IDENTIFIER = tv.mta.jwplayer.jwplayerFlutter; 525 | PRODUCT_NAME = "$(TARGET_NAME)"; 526 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 527 | SWIFT_SWIFT3_OBJC_INFERENCE = On; 528 | SWIFT_VERSION = 4.0; 529 | VERSIONING_SYSTEM = "apple-generic"; 530 | }; 531 | name = Release; 532 | }; 533 | /* End XCBuildConfiguration section */ 534 | 535 | /* Begin XCConfigurationList section */ 536 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 537 | isa = XCConfigurationList; 538 | buildConfigurations = ( 539 | 97C147031CF9000F007C117D /* Debug */, 540 | 97C147041CF9000F007C117D /* Release */, 541 | 249021D3217E4FDB00AE95B9 /* Profile */, 542 | ); 543 | defaultConfigurationIsVisible = 0; 544 | defaultConfigurationName = Release; 545 | }; 546 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 547 | isa = XCConfigurationList; 548 | buildConfigurations = ( 549 | 97C147061CF9000F007C117D /* Debug */, 550 | 97C147071CF9000F007C117D /* Release */, 551 | 249021D4217E4FDB00AE95B9 /* Profile */, 552 | ); 553 | defaultConfigurationIsVisible = 0; 554 | defaultConfigurationName = Release; 555 | }; 556 | /* End XCConfigurationList section */ 557 | }; 558 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 559 | } 560 | --------------------------------------------------------------------------------