Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
F
flutter_plugin
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
林生雨
flutter_plugin
Commits
23f700a2
Commit
23f700a2
authored
Nov 01, 2019
by
林生雨
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
commit
parent
a2d54ab0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
185 additions
and
67 deletions
+185
-67
workspace.xml
.idea/workspace.xml
+37
-48
AlbumModel.dart
example/lib/AlbumModel/page/album/AlbumModel.dart
+20
-17
GengmeiFlutterPlugin.m
ios/Classes/GengmeiFlutterPlugin.m
+24
-0
MyPlayerViewController.h
ios/Classes/MyPlayerViewController.h
+18
-0
MyPlayerViewController.m
ios/Classes/MyPlayerViewController.m
+77
-0
ScanImagePlugn.dart
lib/ScanImagePlugn.dart
+5
-2
gengmei_flutter_plugin.dart
lib/gengmei_flutter_plugin.dart
+4
-0
No files found.
.idea/workspace.xml
View file @
23f700a2
...
@@ -6,18 +6,16 @@
...
@@ -6,18 +6,16 @@
</component>
</component>
<component
name=
"ChangeListManager"
>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
>
<list
default=
"true"
id=
"5be6bbb5-7d6e-4540-a24f-d2b3bf78b3ba"
name=
"Default Changelist"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/Anim.dart"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/preview/AlbumPreviewModel.dart"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/preview/AlbumPreviewPage.dart"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/Anim.dart"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/preview/AlbumPreviewModel.dart"
afterDir=
"false"
/>
<change
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/preview/AlbumPreviewPage.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/lib/ScanImagePlugn.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/lib/ScanImagePlugn.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/lib/gengmei_flutter_plugin.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/ios/.symlinks/plugins/gengmei_flutter_plugin/lib/gengmei_flutter_plugin.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/ios/Classes/GengmeiFlutterPlugin.m"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
afterDir=
"false"
/>
</list>
</list>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.dart_tool/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
<ignored
path=
"$PROJECT_DIR$/.idea/"
/>
...
@@ -40,8 +38,8 @@
...
@@ -40,8 +38,8 @@
<file
pinned=
"false"
current-in-tab=
"true"
>
<file
pinned=
"false"
current-in-tab=
"true"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
396
"
>
<state
relative-caret-position=
"
164
"
>
<caret
line=
"3
69"
selection-start-line=
"369"
selection-end-line=
"369
"
/>
<caret
line=
"3
56"
selection-start-line=
"356"
selection-end-line=
"356
"
/>
<folding>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
</folding>
...
@@ -97,8 +95,8 @@
...
@@ -97,8 +95,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
325
"
>
<state
relative-caret-position=
"
204
"
>
<caret
line=
"
49"
selection-start-line=
"49"
selection-end-line=
"52"
selection-end-column=
"3
"
/>
<caret
line=
"
54"
column=
"55"
selection-start-line=
"54"
selection-start-column=
"39"
selection-end-line=
"54"
selection-end-column=
"55
"
/>
<folding>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
</folding>
...
@@ -109,8 +107,8 @@
...
@@ -109,8 +107,8 @@
<file
pinned=
"false"
current-in-tab=
"false"
>
<file
pinned=
"false"
current-in-tab=
"false"
>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
29
1"
>
<state
relative-caret-position=
"
40
1"
>
<caret
line=
"
29"
column=
"35"
selection-start-line=
"29"
selection-start-column=
"21"
selection-end-line=
"29"
selection-end-column=
"35
"
/>
<caret
line=
"
34"
column=
"41"
selection-start-line=
"34"
selection-start-column=
"41"
selection-end-line=
"34"
selection-end-column=
"41
"
/>
<folding>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
</folding>
</folding>
...
@@ -197,18 +195,18 @@
...
@@ -197,18 +195,18 @@
<option
value=
"$PROJECT_DIR$/lib/SharedPlugin.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/SharedPlugin.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/main.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/main.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/repository/AlbumRepository.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/preview/AlbumPreviewModel.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/preview/AlbumPreviewModel.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumPage.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/preview/AlbumPreviewPage.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/preview/AlbumPreviewPage.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
/>
<option
value=
"$PROJECT_DIR$/lib/ScanImagePlugn.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
<option
value=
"$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
/>
</list>
</list>
</option>
</option>
</component>
</component>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<component
name=
"ProjectFrameBounds"
extendedState=
"6"
>
<option
name=
"x"
value=
"
-79
"
/>
<option
name=
"x"
value=
"
91
"
/>
<option
name=
"y"
value=
"2
4
"
/>
<option
name=
"y"
value=
"2
3
"
/>
<option
name=
"width"
value=
"1440"
/>
<option
name=
"width"
value=
"1440"
/>
<option
name=
"height"
value=
"811"
/>
<option
name=
"height"
value=
"811"
/>
</component>
</component>
...
@@ -263,15 +261,6 @@
...
@@ -263,15 +261,6 @@
<item
name=
"page"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"page"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"album"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"album"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
</path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"example"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"lib"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"AlbumModel"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"page"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"preview"
type=
"462c0819:PsiDirectoryNode"
/>
</path>
<path>
<path>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"b2602c69:ProjectViewProjectNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
<item
name=
"gengmei_flutter_plugin"
type=
"462c0819:PsiDirectoryNode"
/>
...
@@ -587,26 +576,6 @@
...
@@ -587,26 +576,6 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"325"
>
<caret
line=
"49"
selection-start-line=
"49"
selection-end-line=
"52"
selection-end-column=
"3"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"291"
>
<caret
line=
"29"
column=
"35"
selection-start-line=
"29"
selection-start-column=
"21"
selection-end-line=
"29"
selection-end-column=
"35"
/>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/Anim.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/Anim.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"-1390"
/>
<state
relative-caret-position=
"-1390"
/>
...
@@ -639,10 +608,30 @@
...
@@ -639,10 +608,30 @@
</state>
</state>
</provider>
</provider>
</entry>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/gengmei_flutter_plugin.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"401"
>
<caret
line=
"34"
column=
"41"
selection-start-line=
"34"
selection-start-column=
"41"
selection-end-line=
"34"
selection-end-column=
"41"
/>
<folding>
<element
signature=
"e#0#20#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/lib/ScanImagePlugn.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"204"
>
<caret
line=
"54"
column=
"55"
selection-start-line=
"54"
selection-start-column=
"39"
selection-end-line=
"54"
selection-end-column=
"55"
/>
<folding>
<element
signature=
"e#45#86#0"
expanded=
"true"
/>
</folding>
</state>
</provider>
</entry>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<entry
file=
"file://$PROJECT_DIR$/example/lib/AlbumModel/page/album/AlbumModel.dart"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<provider
selected=
"true"
editor-type-id=
"text-editor"
>
<state
relative-caret-position=
"
396
"
>
<state
relative-caret-position=
"
164
"
>
<caret
line=
"3
69"
selection-start-line=
"369"
selection-end-line=
"369
"
/>
<caret
line=
"3
56"
selection-start-line=
"356"
selection-end-line=
"356
"
/>
<folding>
<folding>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
<element
signature=
"e#46#66#0"
expanded=
"true"
/>
</folding>
</folding>
...
...
example/lib/AlbumModel/page/album/AlbumModel.dart
View file @
23f700a2
...
@@ -96,12 +96,11 @@ class AlbumModel {
...
@@ -96,12 +96,11 @@ class AlbumModel {
// }
// }
// });
// });
// }
// }
compute
(
paseAlbum
,
event
).
then
((
value
){
compute
(
paseAlbum
,
event
).
then
((
value
)
{
_mainValue
=
value
;
_mainValue
=
value
;
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
albumLive
.
notifyView
(
_mainValue
[
_nowDirName
]);
});
});
// _mainValue=newMap;
// _mainValue=newMap;
// var list = map[_nowDirName];
// var list = map[_nowDirName];
// _mainValue.forEach((k, itemList) {
// _mainValue.forEach((k, itemList) {
...
@@ -133,7 +132,6 @@ class AlbumModel {
...
@@ -133,7 +132,6 @@ class AlbumModel {
// }
// }
// }
// }
// print("EVENTTTT !! ${tempList.length} ${tempList}");
// print("EVENTTTT !! ${tempList.length} ${tempList}");
}
}
void
_onError
(
Object
error
)
{
void
_onError
(
Object
error
)
{
...
@@ -146,8 +144,7 @@ class AlbumModel {
...
@@ -146,8 +144,7 @@ class AlbumModel {
.
receiveBroadcastStream
()
.
receiveBroadcastStream
()
.
listen
(
_onEvent
,
onError:
_onError
);
.
listen
(
_onEvent
,
onError:
_onError
);
// }
// }
AlbumRepository
.
getInstance
().
scanPhoneImg
()
AlbumRepository
.
getInstance
().
scanPhoneImg
().
listen
((
value
)
{
.
listen
((
value
)
{
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
_mainValue
=
value
;
_mainValue
=
value
;
value
.
forEach
((
key
,
eachValue
)
{
value
.
forEach
((
key
,
eachValue
)
{
...
@@ -347,26 +344,32 @@ class AlbumModel {
...
@@ -347,26 +344,32 @@ class AlbumModel {
showPop
=
false
;
showPop
=
false
;
albumLive
.
notifyView
(
_mainValue
[
dirName
]);
albumLive
.
notifyView
(
_mainValue
[
dirName
]);
}
}
bool
previewItemClick
=
false
;
bool
previewItemClick
=
false
;
void
previewItem
(
BuildContext
context
,
int
index
,
String
pageName
)
{
void
previewItem
(
BuildContext
context
,
int
index
,
String
pageName
)
{
String
path
;
String
path
;
if
(
Platform
.
isAndroid
)
{
if
(
Platform
.
isAndroid
)
{
path
=
albumLive
.
data
[
index
].
realPath
;
path
=
albumLive
.
data
[
index
].
realPath
;
Navigator
.
push
(
context
,
CustomRoute
(
AlbumPreviewPage
(
path
,
pageName
)));
Navigator
.
push
(
context
,
CustomRoute
(
AlbumPreviewPage
(
path
,
pageName
)));
}
else
{
}
else
{
path
=
albumLive
.
data
[
index
].
path
;
if
(
albumLive
.
data
[
index
].
isVideo
)
{
GengmeiFlutterPlugin
.
playAlbumVideo
(
path
);
}
else
{
if
(
previewItemClick
)
{
return
;
}
previewItemClick
=
true
;
iosItem
(
path
,
context
,
(
value
)
{
var
realPath
=
value
[
"realImagePath"
];
Navigator
.
push
(
context
,
CustomRoute
(
AlbumPreviewPage
(
realPath
,
pageName
)));
});
}
// Navigator.push(
// Navigator.push(
// context, CustomRoute(AlbumPreviewPage(albumLive.data[index].path, pageName)));
// context, CustomRoute(AlbumPreviewPage(albumLive.data[index].path, pageName)));
if
(
previewItemClick
)
{
return
;
}
previewItemClick
=
true
;
path
=
albumLive
.
data
[
index
].
path
;
iosItem
(
path
,
context
,
(
value
)
{
var
realPath
=
value
[
"realImagePath"
];
Navigator
.
push
(
context
,
CustomRoute
(
AlbumPreviewPage
(
realPath
,
pageName
)));
});
}
}
}
}
...
@@ -375,9 +378,9 @@ class AlbumModel {
...
@@ -375,9 +378,9 @@ class AlbumModel {
if
(
value
!=
null
)
{
if
(
value
!=
null
)
{
fun
(
Map
<
String
,
String
>.
from
(
value
));
fun
(
Map
<
String
,
String
>.
from
(
value
));
}
}
previewItemClick
=
false
;
previewItemClick
=
false
;
}).
catchError
((
error
)
{
}).
catchError
((
error
)
{
previewItemClick
=
false
;
previewItemClick
=
false
;
print
(
error
);
print
(
error
);
});
});
}
}
...
...
ios/Classes/GengmeiFlutterPlugin.m
View file @
23f700a2
...
@@ -4,6 +4,8 @@
...
@@ -4,6 +4,8 @@
#import "Image/AlbumItem.h"
#import "Image/AlbumItem.h"
#import "ResultManager.h"
#import "ResultManager.h"
#import <ImageIO/ImageIO.h>
#import <ImageIO/ImageIO.h>
#import <AVKit/AVKit.h>
#import "MyPlayerViewController.h"
@interface
GengmeiFlutterPlugin
()
<
UIActionSheetDelegate
,
UIImagePickerControllerDelegate
,
UINavigationControllerDelegate
,
FlutterStreamHandler
>
//一定要声明这三个协议,缺一不可
@interface
GengmeiFlutterPlugin
()
<
UIActionSheetDelegate
,
UIImagePickerControllerDelegate
,
UINavigationControllerDelegate
,
FlutterStreamHandler
>
//一定要声明这三个协议,缺一不可
//@property(nonatomic)FlutterResult result;
//@property(nonatomic)FlutterResult result;
...
@@ -408,6 +410,28 @@ NSString *cacheDirectory;
...
@@ -408,6 +410,28 @@ NSString *cacheDirectory;
}
else
{
}
else
{
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
nil
];
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
nil
];
}
}
}
else
if
([
@"play_album_video"
isEqualToString
:
call
.
method
]
){
long
resultTemp
=
self
.
resultKey
;
NSString
*
path
=
call
.
arguments
;
if
([[
self
.
scanMap
allKeys
]
containsObject
:
path
]){
PHAsset
*
assets
=
self
.
scanMap
[
path
];
MyPlayerViewController
*
video
=
[[
MyPlayerViewController
alloc
]
init
];
[
viewController
presentViewController
:
video
animated
:
YES
completion
:
nil
];
// video.player= [[AVPlayeralloc]initWithURL:url];
[
video
playMovie
:
assets
];
[[
ResultManager
sharedSingleton
]
resultSuccess
:[
NSNumber
numberWithLong
:
resultTemp
]
:
@YES
];
// PHVideoRequestOptions *options = [[PHVideoRequestOptions alloc] init];
// options.version = PHImageRequestOptionsVersionCurrent;
// options.networkAccessAllowed = true;
// options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic;
// [[PHImageManager defaultManager]requestAVAssetForVideo:assets options:options resultHandler:^(AVAsset * _Nullable asset, AVAudioMix * _Nullable audioMix, NSDictionary * _Nullable info) {
// AVURLAsset *urlAsset = (AVURLAsset *)asset;
// AVPlayerViewController* video=[[AVPlayerViewController alloc] init];
// [viewController presentViewController:video animated:YES completion:nil];
// [video playMovie:urlAsset.URL];
// [[ResultManager sharedSingleton] resultSuccess:[NSNumber numberWithLong:resultTemp] :@YES];
// }];
}
}
else
{
}
else
{
result
(
FlutterMethodNotImplemented
);
result
(
FlutterMethodNotImplemented
);
}
}
...
...
ios/Classes/MyPlayerViewController.h
0 → 100644
View file @
23f700a2
//
// AVPlayerViewController.h
// Pods
//
// Created by Apple on 2019/11/1.
//
#ifndef AVPlayerViewController_h
#define AVPlayerViewController_h
#endif
/* AVPlayerViewController_h */
#import <AssetsLibrary/AssetsLibrary.h>
#import <Photos/Photos.h>
@interface
MyPlayerViewController
:
UIViewController
-
(
void
)
playMovie
:(
PHAsset
*
)
assets
;
@end
ios/Classes/MyPlayerViewController.m
0 → 100644
View file @
23f700a2
//
// AVPlayerViewController.m
// gengmei_flutter_plugin
//
// Created by Apple on 2019/11/1.
//
#import <Foundation/Foundation.h>
#import "MyPlayerViewController.h"
#import <AVFoundation/AVFoundation.h>
#import <AVKit/AVKit.h>
#import <AssetsLibrary/AssetsLibrary.h>
#import <Photos/Photos.h>
@interface
MyPlayerViewController
()
@property
(
nonatomic
)
dispatch_queue_t
queue
;;
@end
@implementation
MyPlayerViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
self
.
queue
=
dispatch_queue_create
(
"com.gengmei_flutter_plugin"
,
DISPATCH_QUEUE_SERIAL
);
// UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
// button.frame = CGRectMake(100, 100, 100, 100);
// [button setTitle:@"TICK" forState:UIControlStateNormal];
// button.backgroundColor = [UIColor brownColor];
// [button addTarget:self action:@selector(playMovie) forControlEvents:UIControlEventTouchUpInside];
// [self.view addSubview:button];
}
-
(
void
)
playMovie
:
(
PHAsset
*
)
assets
{
dispatch_async
(
self
.
queue
,
^
{
PHVideoRequestOptions
*
options
=
[[
PHVideoRequestOptions
alloc
]
init
];
// options.version = PHImageRequestOptionsVersionCurrent;
options
.
networkAccessAllowed
=
true
;
// options.deliveryMode = PHVideoRequestOptionsDeliveryModeAutomatic;
[[
PHImageManager
defaultManager
]
requestAVAssetForVideo
:
assets
options
:
options
resultHandler
:^
(
AVAsset
*
_Nullable
asset
,
AVAudioMix
*
_Nullable
audioMix
,
NSDictionary
*
_Nullable
info
)
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
AVURLAsset
*
urlAsset
=
(
AVURLAsset
*
)
asset
;
// AVPlayerViewController* video=[[AVPlayerViewController alloc] init];
// [viewController presentViewController:video animated:YES completion:nil];
// [video playMovie:urlAsset.URL];
AVPlayer
*
player
=
[
AVPlayer
playerWithURL
:
urlAsset
.
URL
];
// 2.创建视频播放视图的控制器
AVPlayerViewController
*
playerVC
=
[[
AVPlayerViewController
alloc
]
init
];
playerVC
.
player
=
player
;
playerVC
.
entersFullScreenWhenPlaybackBegins
=
YES
;
playerVC
.
exitsFullScreenWhenPlaybackEnds
=
YES
;
playerVC
.
videoGravity
=
AVLayerVideoGravityResizeAspect
;
playerVC
.
view
.
center
=
self
.
view
.
center
;
playerVC
.
view
.
frame
=
self
.
view
.
bounds
;
playerVC
.
showsPlaybackControls
=
YES
;
playerVC
.
view
.
translatesAutoresizingMaskIntoConstraints
=
YES
;
// 隐藏 控制控件
// playerVC.showsPlaybackControls = NO;
// [self presentViewController:playerVC animated:YES completion:nil];
// 自定义位置
// playerVC.view.frame = CGRectMake(200, 300, 300, 300);
[
self
.
view
addSubview
:
playerVC
.
view
];
[
self
addChildViewController
:
playerVC
];
// if (playerVC.readyForDisplay) {
[
playerVC
.
player
play
];
// }
});
}];
});
// 1.AVPlayer
}
@end
lib/ScanImagePlugn.dart
View file @
23f700a2
...
@@ -47,10 +47,13 @@ class ScanImagePlugn {
...
@@ -47,10 +47,13 @@ class ScanImagePlugn {
return
await
channel
.
invokeMethod
(
"IOS_IMAGE_BY_PATH"
,
path
);
return
await
channel
.
invokeMethod
(
"IOS_IMAGE_BY_PATH"
,
path
);
}
}
static
Future
<
Map
>
ios_album_item
(
static
Future
<
Map
>
ios_album_item
(
MethodChannel
channel
,
String
path
)
async
{
MethodChannel
channel
,
String
path
)
async
{
return
await
channel
.
invokeMethod
(
"IOS_IMAGE_ITEM"
,
path
);
return
await
channel
.
invokeMethod
(
"IOS_IMAGE_ITEM"
,
path
);
}
}
static
Future
<
bool
>
playAlbumVideo
(
MethodChannel
channel
,
String
path
)
async
{
return
await
channel
.
invokeMethod
(
"play_album_video"
,
path
);
}
}
}
class
ScanImageItem
{
class
ScanImageItem
{
...
...
lib/gengmei_flutter_plugin.dart
View file @
23f700a2
...
@@ -31,6 +31,10 @@ class GengmeiFlutterPlugin {
...
@@ -31,6 +31,10 @@ class GengmeiFlutterPlugin {
return
await
ScanImagePlugn
.
ios_album_item
(
_channel
,
path
);
return
await
ScanImagePlugn
.
ios_album_item
(
_channel
,
path
);
}
}
static
Future
<
bool
>
playAlbumVideo
(
String
path
)
async
{
return
await
ScanImagePlugn
.
playAlbumVideo
(
_channel
,
path
);
}
static
Future
<
bool
>
quitPage
()
async
{
static
Future
<
bool
>
quitPage
()
async
{
return
await
ScanImagePlugn
.
quitPage
(
_channel
);
return
await
ScanImagePlugn
.
quitPage
(
_channel
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment