Caijinglong %!s(int64=6) %!d(string=hai) anos
pai
achega
2d78087a37

+ 1 - 1
.gitattributes

@@ -1 +1 @@
-ios/IJKMediaFramework.framework filter=lfs diff=lfs merge=lfs -text
+ios/IJKMediaFramework.framework/IJKMediaFramework filter=lfs diff=lfs merge=lfs -text

+ 3 - 16
example/ios/Podfile.lock

@@ -2,33 +2,20 @@ PODS:
   - Flutter (1.0.0)
   - flutter_ijkplayer (0.0.1):
     - Flutter
-    - ijkplayer (~> 1.1.3)
-  - ijkplayer (1.1.3)
-  - permission (0.0.1):
-    - Flutter
 
 DEPENDENCIES:
   - Flutter (from `.symlinks/flutter/ios`)
-  - flutter_ijkplayer (from `/Users/caijinglong/Documents/GitHub/flutter_ijkplayer/ios/flutter_ijkplayer.podspec`)
-  - permission (from `/Users/caijinglong/.pub-cache/hosted/pub.flutter-io.cn/permission-0.1.1/ios/permission.podspec`)
-
-SPEC REPOS:
-  https://github.com/cocoapods/specs.git:
-    - ijkplayer
+  - flutter_ijkplayer (from `/Volumes/Evo512/code/flutter/plugins/ijkplayer/ios/flutter_ijkplayer.podspec`)
 
 EXTERNAL SOURCES:
   Flutter:
     :path: ".symlinks/flutter/ios"
   flutter_ijkplayer:
-    :path: "/Users/caijinglong/Documents/GitHub/flutter_ijkplayer/ios/flutter_ijkplayer.podspec"
-  permission:
-    :path: "/Users/caijinglong/.pub-cache/hosted/pub.flutter-io.cn/permission-0.1.1/ios/permission.podspec"
+    :path: "/Volumes/Evo512/code/flutter/plugins/ijkplayer/ios/flutter_ijkplayer.podspec"
 
 SPEC CHECKSUMS:
   Flutter: 9d0fac939486c9aba2809b7982dfdbb47a7b0296
-  flutter_ijkplayer: 7d74293774f0ea2a0cb21bb8581b5a92d00640e9
-  ijkplayer: 1a1a33f5b0387bd7ea297337853130b9ddb20093
-  permission: 3781bb5a85794b350fa6d978f702abe4d87ff2d9
+  flutter_ijkplayer: add1e58f2329ca825b03decb062a9167be9bbc59
 
 PODFILE CHECKSUM: a14c63eb48a9d676ed6d876506b3258fd9c85235
 

+ 1 - 0
example/ios/Runner.xcodeproj/project.pbxproj

@@ -107,6 +107,7 @@
 				97C146EF1CF9000F007C117D /* Products */,
 				2ABB07C25A743DD406317260 /* Pods */,
 				6E7E052C96895F1848299B95 /* Frameworks */,
+				17FCB4C9246909762D05E086 /* FLTVideoPlayer.m */,
 			);
 			sourceTree = "<group>";
 		};

+ 8 - 0
example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IDEDidComputeMac32BitWarning</key>
+	<true/>
+</dict>
+</plist>

+ 8 - 0
example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildSystemType</key>
+	<string>Original</string>
+</dict>
+</plist>

+ 18 - 0
ios/Classes/FlutterIJK.h

@@ -0,0 +1,18 @@
+//
+// Created by Caijinglong on 2019-03-08.
+//
+
+#import <Foundation/Foundation.h>
+#import <Flutter/Flutter.h>
+
+@interface FlutterIJK : NSObject
+
+@property(nonatomic, strong) NSObject <FlutterPluginRegistrar> *registrar;
+
+- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar;
+
++ (instancetype)ijkWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar;
+
+- (int64_t)id;
+
+@end

+ 64 - 0
ios/Classes/FlutterIJK.m

@@ -0,0 +1,64 @@
+//
+// Created by Caijinglong on 2019-03-08.
+//
+
+#import "FlutterIJK.h"
+#import <IJKMediaFramework/IJKMediaFramework.h>
+#import <IJKMediaFramework/IJKMediaPlayer.h>
+#import <AVFoundation/AVFoundation.h>
+
+@interface IJKVideoPlayer : NSObject <FlutterTexture>
+@end
+
+@interface FlutterIJK ()
+@end
+
+@implementation FlutterIJK {
+    int64_t textureId;
+    IJKVideoPlayer *player;
+}
+- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar {
+    self = [super init];
+    if (self) {
+        self.registrar = registrar;
+        IJKMPMoviePlayerController *controller = [[IJKMPMoviePlayerController alloc] initWithContentURLString:@""];
+        NSObject <FlutterTextureRegistry> *textures = [self.registrar textures];
+        textureId = [textures registerTexture:player];
+    }
+
+    return self;
+}
+
++ (instancetype)ijkWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar {
+    return [[self alloc] initWithRegistrar:registrar];
+}
+
+- (int64_t)id {
+    return textureId;
+}
+
+@end
+
+@implementation IJKVideoPlayer {
+    IJKFFMoviePlayerController *controller;
+}
+
+- (instancetype)init {
+    self = [super init];
+    if (self) {
+        IJKFFOptions *options = [IJKFFOptions optionsByDefault];
+        NSString *urlString = @"https://www.sample-videos.com/video123/mp4/720/big_buck_bunny_720p_1mb.mp4";
+        controller = [[IJKFFMoviePlayerController alloc] initWithContentURLString:urlString withOptions:options];
+        [controller prepareToPlay];
+        [controller play];
+    }
+
+    return self;
+}
+
+
+- (CVPixelBufferRef _Nullable)copyPixelBuffer {
+    return [controller framePixelbuffer];
+}
+
+@end

+ 18 - 0
ios/Classes/FlutterIjkManager.h

@@ -0,0 +1,18 @@
+//
+// Created by Caijinglong on 2019-03-08.
+//
+
+#import <Foundation/Foundation.h>
+#import <Flutter/Flutter.h>
+
+@interface FlutterIjkManager : NSObject
+
+@property(nonatomic, strong) NSObject <FlutterPluginRegistrar> *registrar;
+
+- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar;
+
++ (instancetype)managerWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar;
+
+- (int64_t)create;
+
+@end

+ 34 - 0
ios/Classes/FlutterIjkManager.m

@@ -0,0 +1,34 @@
+//
+// Created by Caijinglong on 2019-03-08.
+//
+
+#import "FlutterIjkManager.h"
+#import "FlutterIJK.h"
+#import <IJKMediaFramework/IJKMediaFramework.h>
+
+@implementation FlutterIjkManager {
+    NSObject <FlutterTextureRegistry> *textures;
+}
+
+
+- (instancetype)initWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar {
+    self = [super init];
+    if (self) {
+        self.registrar = registrar;
+        textures = [registrar textures];
+    }
+
+    return self;
+}
+
++ (instancetype)managerWithRegistrar:(NSObject <FlutterPluginRegistrar> *)registrar {
+    return [[self alloc] initWithRegistrar:registrar];
+}
+
+- (int64_t)create {
+    FlutterIJK *ijk = [FlutterIJK ijkWithRegistrar:self.registrar];
+    return [ijk id];
+}
+
+
+@end

+ 10 - 4
ios/Classes/IjkplayerPlugin.m

@@ -3,15 +3,21 @@
 @implementation IjkplayerPlugin
 + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
   FlutterMethodChannel* channel = [FlutterMethodChannel
-      methodChannelWithName:@"ijkplayer"
-            binaryMessenger:[registrar messenger]];
+          methodChannelWithName:@"top.kikt/ijkplayer"
+                binaryMessenger:[registrar messenger]];
   IjkplayerPlugin* instance = [[IjkplayerPlugin alloc] init];
   [registrar addMethodCallDelegate:instance channel:channel];
 }
 
 - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
-  if ([@"getPlatformVersion" isEqualToString:call.method]) {
-    result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]);
+
+
+  if ([@"create" isEqualToString:call.method]) {
+  } else if ([@"dispose" isEqualToString:call.method]) {
+  } else if ([@"play" isEqualToString:call.method]) {
+  } else if ([@"pause" isEqualToString:call.method]) {
+  } else if ([@"stop" isEqualToString:call.method]) {
+  } else if ([@"setDataSource" isEqualToString:call.method]) {
   } else {
     result(FlutterMethodNotImplemented);
   }