├── .gitattributes ├── .gitignore ├── .idea ├── codeStyles │ └── Project.xml ├── dbnavigator.xml ├── inspectionProfiles │ └── Project_Default.xml ├── libraries │ ├── Dart_SDK.xml │ ├── Flutter_Plugins.xml │ └── Flutter_for_Android.xml ├── modules.xml ├── runConfigurations │ └── example_lib_main_dart.xml ├── vcs.xml └── workspace.xml ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── android ├── .gitignore ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ └── gradle-wrapper.properties ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── iqingbai │ └── faliplayer │ ├── FAliPlayerSingleTextureView.java │ ├── FAliPlayerTextureView.java │ ├── FaliplayerPlugin.java │ ├── ShareFAliPlayerFactory.java │ └── ShareFAliSinglePlayerFactory.java ├── example ├── .gitignore ├── .metadata ├── README.md ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── iqingbai │ │ │ │ │ └── faliplayer_example │ │ │ │ │ └── MainActivity.java │ │ │ └── res │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── 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 │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── Runner │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ ├── Contents.json │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ ├── 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-83.5x83.5@2x.png │ │ └── LaunchImage.imageset │ │ │ ├── Contents.json │ │ │ ├── LaunchImage.png │ │ │ ├── LaunchImage@2x.png │ │ │ ├── LaunchImage@3x.png │ │ │ └── README.md │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ └── main.m ├── lib │ └── main.dart ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── faliplayer.iml ├── gif └── s.gif ├── ios ├── .gitignore ├── Assets │ └── .gitkeep ├── Classes │ ├── FAliPlayListFactory.h │ ├── FAliPlayListFactory.m │ ├── FAliPlayerView.h │ ├── FAliPlayerView.m │ ├── FaliplayerPlugin.h │ └── FaliplayerPlugin.m └── faliplayer.podspec ├── lib ├── faliplayer.dart └── src │ ├── aliplayer.dart │ ├── controller.dart │ └── list │ ├── alilistcontroller.dart │ └── alilistplayer.dart ├── pubspec.lock ├── pubspec.yaml └── test └── faliplayer_test.dart /.gitattributes: -------------------------------------------------------------------------------- 1 | *.java linguist-detectable=false 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | -------------------------------------------------------------------------------- /.idea/codeStyles/Project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 21 | 22 | 26 | 27 | 28 | 29 | 31 | 32 | 33 |
34 | 35 | 36 | 37 | xmlns:android 38 | 39 | ^$ 40 | 41 | 42 | 43 |
44 |
45 | 46 | 47 | 48 | xmlns:.* 49 | 50 | ^$ 51 | 52 | 53 | BY_NAME 54 | 55 |
56 |
57 | 58 | 59 | 60 | .*:id 61 | 62 | http://schemas.android.com/apk/res/android 63 | 64 | 65 | 66 |
67 |
68 | 69 | 70 | 71 | .*:name 72 | 73 | http://schemas.android.com/apk/res/android 74 | 75 | 76 | 77 |
78 |
79 | 80 | 81 | 82 | name 83 | 84 | ^$ 85 | 86 | 87 | 88 |
89 |
90 | 91 | 92 | 93 | style 94 | 95 | ^$ 96 | 97 | 98 | 99 |
100 |
101 | 102 | 103 | 104 | .* 105 | 106 | ^$ 107 | 108 | 109 | BY_NAME 110 | 111 |
112 |
113 | 114 | 115 | 116 | .* 117 | 118 | http://schemas.android.com/apk/res/android 119 | 120 | 121 | ANDROID_ATTRIBUTE_ORDER 122 | 123 |
124 |
125 | 126 | 127 | 128 | .* 129 | 130 | .* 131 | 132 | 133 | BY_NAME 134 | 135 |
136 |
137 |
138 |
139 |
140 |
-------------------------------------------------------------------------------- /.idea/dbnavigator.xml: -------------------------------------------------------------------------------- 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 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 198 | 199 | 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | 413 | 414 | 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 436 | 437 | 438 | 439 | 440 | 441 | 442 | 443 | 444 | 445 | 446 | 447 | 448 | 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/libraries/Dart_SDK.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_Plugins.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/libraries/Flutter_for_Android.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/runConfigurations/example_lib_main_dart.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/workspace.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 30 | 31 | 33 | 34 | 35 | 40 | 41 | 42 | 43 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 1584518535021 84 | 88 | 89 | 1584591392179 90 | 95 | 96 | 1584591579556 97 | 102 | 103 | 1584611703179 104 | 109 | 110 | 1584614975767 111 | 116 | 117 | 1584615838028 118 | 123 | 124 | 1584616343574 125 | 130 | 131 | 1584620896564 132 | 137 | 140 | 141 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 160 | -------------------------------------------------------------------------------- /.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: 0b8abb4724aa590dd0f429683339b1e045a1594d 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.0.1 2 | 3 | * TODO: Describe initial release. 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Dovvvis 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FAliplayer 2 | 3 | Flutter版的阿里云列表播放器,支持边播边缓存 4 | 5 | [![pub package](https://img.shields.io/pub/v/faliplayer.svg)](https://pub.dev/packages/faliplayer) 6 | [![GitHub stars](https://img.shields.io/github/stars/Dovvvis/FAliPlayer)](https://github.com/Dovvvis/FAliPlayer/stargazers) 7 | ![GitHub issues](https://img.shields.io/github/issues/Dovvvis/FAliPlayer) 8 | 9 | 10 | # 示例效果 11 | ![gif图加载慢请耐心等待](https://github.com/Dovvvis/FAliPlayer/blob/master/gif/s.gif) 12 | 13 | [点击此处看视频效果](http://video.iqingbai.com/RPReplay_Final1584613529.MP4) 14 | 15 | ### 引入 16 | ``` 17 | import 'package:faliplayer/faliplayer.dart'; 18 | ``` 19 | ### 示例 20 | ``` 21 | class MyApp extends StatefulWidget { 22 | @override 23 | _MyAppState createState() => _MyAppState(); 24 | } 25 | 26 | class _MyAppState extends State { 27 | FAliListPlayerController controller; 28 | List urls = [ 29 | ... 30 | ]; 31 | 32 | @override 33 | void initState() { 34 | super.initState(); 35 | ///初始化 36 | controller = FAliListPlayerController(isAutoPlay: true, loop: true); 37 | ///添加视频源 38 | controller.addUrls(urls); 39 | } 40 | 41 | @override 42 | Widget build(BuildContext context) { 43 | return MaterialApp( 44 | home: Scaffold( 45 | appBar: AppBar( 46 | title: const Text('Plugin example app'), 47 | ), 48 | body: FAliPlayerView.builder( 49 | controller: controller, 50 | ///视频列表每页的UI 51 | pageBuilder: (c, i) { 52 | return ...; 53 | }, 54 | ///每个视频的缩略图 55 | thumbImageBuilder: (c, i, h, w) { 56 | return ...; 57 | }, 58 | ), 59 | ), 60 | ); 61 | } 62 | } 63 | 64 | ``` 65 | ### 控制播放 66 | ``` 67 | //开始 68 | controller.start(); 69 | //暂停 70 | controller.pause(); 71 | //移动到某个视频并播放 72 | controller.moveTo(0); 73 | //下一个 74 | controller.moveToNext(); 75 | //上一个 76 | controller.moveToPre(); 77 | //跳转 78 | controller.seekTo(positon); 79 | ``` 80 | ### 监听 81 | 82 | ``` 83 | //播放位置更新监听 84 | controller.setPositionUpdateListener((position) { 85 | 86 | }); 87 | 88 | //缓存位置更新监听 89 | controller.setBufferedPositionUpdateListener((position) { 90 | 91 | }); 92 | 93 | //视频大小变化监听 94 | controller.setOnVideoSizeChanged((){ 95 | 96 | }); 97 | 98 | //视频播放事件变化监听 99 | controller.setOnPlayEventListener((type){ 100 | 101 | }); 102 | ``` 103 | ### 设置缓存配置 104 | 请在初始化的视频设置,正常在initState处设置 105 | 106 | ``` 107 | controller.setCacheConfig( 108 | AVPCacheConfig(path: d.path, maxDuration: 100, maxSizeMB: 1024)); 109 | ``` 110 | ### 获取缓存文件的路径 111 | 112 | ``` 113 | ///获取缓存文件的路径 114 | ///[url]文件的url 115 | Future getCachePath(String url) 116 | ``` 117 | ### 设置视频显示模式 118 | ``` 119 | Future setScalingMode(AVPScalingMode mode) 120 | ``` 121 | 122 | 属性 | 说明 123 | ------- | ------- 124 | SCALETOFILL | 拉伸(会变形) 125 | SCALEASPECTFIT | 按照原比例显示 126 | SCALEASPECTFILL | 按照原比例显示并充满屏幕 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.iqingbai.faliplayer' 2 | version '1.0' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | jcenter() 8 | 9 | mavenCentral() 10 | maven { 11 | url 'https://maven.aliyun.com/repository/releases' 12 | } 13 | } 14 | 15 | dependencies { 16 | classpath 'com.android.tools.build:gradle:3.5.0' 17 | } 18 | } 19 | 20 | rootProject.allprojects { 21 | repositories { 22 | google() 23 | jcenter() 24 | 25 | mavenCentral() 26 | maven { 27 | url 'https://maven.aliyun.com/repository/releases' 28 | } 29 | } 30 | } 31 | 32 | apply plugin: 'com.android.library' 33 | 34 | android { 35 | compileSdkVersion 28 36 | 37 | defaultConfig { 38 | minSdkVersion 16 39 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 40 | } 41 | lintOptions { 42 | disable 'InvalidPackage' 43 | } 44 | } 45 | dependencies { 46 | implementation 'com.aliyun.sdk.android:AliyunPlayer:4.5.0-full' 47 | implementation 'com.alivc.conan:AlivcConan:0.9.5' 48 | } 49 | -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-all.zip 6 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'faliplayer' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/java/com/iqingbai/faliplayer/FAliPlayerSingleTextureView.java: -------------------------------------------------------------------------------- 1 | package com.iqingbai.faliplayer; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | import android.support.annotation.NonNull; 6 | import android.support.annotation.RequiresApi; 7 | import android.view.SurfaceHolder; 8 | import android.view.SurfaceView; 9 | import android.view.View; 10 | 11 | import com.aliyun.player.AliPlayer; 12 | import com.aliyun.player.AliPlayerFactory; 13 | import com.aliyun.player.IPlayer; 14 | import com.aliyun.player.bean.ErrorInfo; 15 | import com.aliyun.player.bean.InfoBean; 16 | import com.aliyun.player.nativeclass.CacheConfig; 17 | import com.aliyun.player.nativeclass.PlayerConfig; 18 | import com.aliyun.player.source.UrlSource; 19 | 20 | import java.math.BigDecimal; 21 | import java.util.HashMap; 22 | import java.util.List; 23 | 24 | import io.flutter.plugin.common.BinaryMessenger; 25 | import io.flutter.plugin.common.EventChannel; 26 | import io.flutter.plugin.common.MethodCall; 27 | import io.flutter.plugin.common.MethodChannel; 28 | import io.flutter.plugin.platform.PlatformView; 29 | 30 | public class FAliPlayerSingleTextureView implements PlatformView, MethodChannel.MethodCallHandler, IPlayer.OnStateChangedListener, IPlayer.OnPreparedListener, IPlayer.OnInfoListener, IPlayer.OnErrorListener { 31 | int viewId; 32 | private AliPlayer aliPlayer; 33 | private MethodChannel methodChannel; 34 | private EventChannel eventChannel; 35 | private EventChannel.EventSink eventSink; 36 | private SurfaceView surfaceView; 37 | private CacheConfig cacheConfig; 38 | 39 | 40 | @RequiresApi(api = Build.VERSION_CODES.O) 41 | FAliPlayerSingleTextureView(Context context, BinaryMessenger messenger, HashMap args, int viewId) { 42 | createView(context, args); 43 | initChannel(messenger, viewId); 44 | this.viewId = viewId; 45 | } 46 | 47 | private void createView(Context context, HashMap args) { 48 | aliPlayer = AliPlayerFactory.createAliListPlayer(context); 49 | aliPlayer.setOnStateChangedListener(this); 50 | aliPlayer.setOnPreparedListener(this); 51 | aliPlayer.setOnInfoListener(this); 52 | aliPlayer.setOnErrorListener(this); 53 | UrlSource urlSource = new UrlSource(); 54 | urlSource.setUri((String) args.get("url")); 55 | aliPlayer.setDataSource(urlSource); 56 | aliPlayer.setScaleMode(IPlayer.ScaleMode.SCALE_TO_FILL); 57 | aliPlayer.setMute(false); 58 | aliPlayer.setLoop((Boolean) args.get("loop")); 59 | 60 | HashMap map = (HashMap) args.get("cacheConfig"); 61 | cacheConfig = new CacheConfig(); 62 | //开启缓存功能 63 | cacheConfig.mEnable = true; 64 | //能够缓存的单个文件最a大时长。超过此长度则不缓存 65 | assert map != null; 66 | int maxDuration = (int) map.get("maxDuration"); 67 | System.out.println("maxDuration:" + maxDuration); 68 | BigDecimal b = new BigDecimal(maxDuration); 69 | cacheConfig.mMaxDurationS = b.longValue(); 70 | cacheConfig.mMaxSizeMB = (int) map.get("maxSizeMB"); 71 | cacheConfig.mDir = (String) map.get("path"); 72 | aliPlayer.setCacheConfig(cacheConfig); 73 | PlayerConfig config = aliPlayer.getConfig(); 74 | //设置网络超时时间,单位ms 75 | config.mNetworkTimeout = 5000; 76 | //设置超时重试次数。每次重试间隔为networkTimeout。networkRetryCount=0则表示不重试,重试策略app决定,默认值为2 77 | config.mNetworkRetryCount = 2; 78 | surfaceView = new SurfaceView(context); 79 | surfaceView.getHolder().addCallback(new SurfaceHolder.Callback() { 80 | @Override 81 | public void surfaceCreated(SurfaceHolder surfaceHolder) { 82 | aliPlayer.setDisplay(surfaceHolder); 83 | } 84 | 85 | @Override 86 | public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) { 87 | aliPlayer.redraw(); 88 | } 89 | 90 | @Override 91 | public void surfaceDestroyed(SurfaceHolder surfaceHolder) { 92 | aliPlayer.setDisplay(null); 93 | } 94 | }); 95 | aliPlayer.prepare(); 96 | } 97 | 98 | private void initChannel(BinaryMessenger messenger, int viewId) { 99 | this.methodChannel = new MethodChannel(messenger, "plugin.iqingbai.com/ali_video_play_single_" + viewId); 100 | this.eventChannel = new EventChannel(messenger, "plugin.iqingbai.com/eventChannel/ali_video_play_single_" + viewId); 101 | eventChannel.setStreamHandler(new EventChannel.StreamHandler() { 102 | @Override 103 | public void onListen(Object arguments, EventChannel.EventSink events) { 104 | eventSink = events; 105 | } 106 | 107 | @Override 108 | public void onCancel(Object arguments) { 109 | eventSink = null; 110 | } 111 | }); 112 | methodChannel.setMethodCallHandler(this); 113 | } 114 | 115 | 116 | @Override 117 | public View getView() { 118 | return surfaceView; 119 | } 120 | 121 | @Override 122 | public void dispose() { 123 | methodChannel = null; 124 | eventChannel = null; 125 | } 126 | 127 | @Override 128 | public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { 129 | System.out.println("call:" + call.method); 130 | switch (call.method) { 131 | case "start": 132 | aliPlayer.start(); 133 | result.success(null); 134 | break; 135 | case "pause": 136 | aliPlayer.pause(); 137 | result.success(null); 138 | break; 139 | case "stop": 140 | aliPlayer.stop(); 141 | result.success(null); 142 | break; 143 | 144 | case "seekTo": 145 | int position = call.argument("position"); 146 | BigDecimal b = new BigDecimal(position); 147 | aliPlayer.seekTo(b.longValue()); 148 | result.success(null); 149 | break; 150 | 151 | // case "setAutoPlay": 152 | // aliListPlayer.setAutoPlay((boolean) call.argument("auto")); 153 | // result.success(null); 154 | // break; 155 | } 156 | } 157 | 158 | @Override 159 | public void onStateChanged(int i) { 160 | System.out.println("onPlayerStatusChanged:" + i); 161 | if (eventSink != null) { 162 | HashMap map = new HashMap<>(); 163 | map.put("eventType", "onPlayerStatusChanged"); 164 | map.put("values", i); 165 | eventSink.success(map); 166 | } 167 | } 168 | 169 | @Override 170 | public void onPrepared() { 171 | System.out.println("onPrepared:"); 172 | 173 | if (eventSink != null) { 174 | HashMap map = new HashMap<>(); 175 | map.put("eventType", "onPrepared"); 176 | eventSink.success(map); 177 | } 178 | } 179 | 180 | @Override 181 | public void onInfo(InfoBean infoBean) { 182 | System.out.println("onInfo:" + infoBean); 183 | HashMap map = new HashMap<>(); 184 | switch (infoBean.getCode().getValue()) { 185 | case 1: 186 | map.put("eventType", "onBufferedPositionUpdate"); 187 | map.put("values", infoBean.getExtraValue()); 188 | eventSink.success(map); 189 | break; 190 | case 2: 191 | map.put("eventType", "onCurrentPositionUpdate"); 192 | map.put("values", infoBean.getExtraValue()); 193 | eventSink.success(map); 194 | break; 195 | } 196 | } 197 | 198 | @Override 199 | public void onError(ErrorInfo errorInfo) { 200 | System.out.println("onError:" + errorInfo.getMsg()); 201 | if (eventSink != null) { 202 | HashMap map = new HashMap<>(); 203 | map.put("eventType", "onError"); 204 | map.put("msg", errorInfo.getMsg()); 205 | map.put("errorCode", errorInfo.getCode()); 206 | eventSink.success(map); 207 | } 208 | } 209 | } 210 | -------------------------------------------------------------------------------- /android/src/main/java/com/iqingbai/faliplayer/FAliPlayerTextureView.java: -------------------------------------------------------------------------------- 1 | package com.iqingbai.faliplayer; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | import android.support.annotation.NonNull; 6 | import android.support.annotation.RequiresApi; 7 | import android.view.SurfaceHolder; 8 | import android.view.SurfaceView; 9 | import android.view.View; 10 | 11 | import com.aliyun.player.AliListPlayer; 12 | import com.aliyun.player.AliPlayerFactory; 13 | import com.aliyun.player.IPlayer; 14 | import com.aliyun.player.bean.ErrorInfo; 15 | import com.aliyun.player.bean.InfoBean; 16 | import com.aliyun.player.bean.InfoCode; 17 | import com.aliyun.player.nativeclass.CacheConfig; 18 | import com.aliyun.player.nativeclass.PlayerConfig; 19 | 20 | import java.math.BigDecimal; 21 | import java.util.HashMap; 22 | import java.util.List; 23 | 24 | import io.flutter.plugin.common.BinaryMessenger; 25 | import io.flutter.plugin.common.EventChannel; 26 | import io.flutter.plugin.common.MethodCall; 27 | import io.flutter.plugin.common.MethodChannel; 28 | import io.flutter.plugin.platform.PlatformView; 29 | 30 | public class FAliPlayerTextureView implements PlatformView, MethodChannel.MethodCallHandler, IPlayer.OnStateChangedListener, IPlayer.OnPreparedListener, IPlayer.OnInfoListener, IPlayer.OnErrorListener, IPlayer.OnVideoSizeChangedListener { 31 | int viewId; 32 | private AliListPlayer aliListPlayer; 33 | private MethodChannel methodChannel; 34 | private EventChannel eventChannel; 35 | private EventChannel.EventSink eventSink; 36 | private SurfaceView surfaceView; 37 | private CacheConfig cacheConfig; 38 | 39 | 40 | @RequiresApi(api = Build.VERSION_CODES.O) 41 | FAliPlayerTextureView(Context context, BinaryMessenger messenger, HashMap args, int viewId) { 42 | System.out.println("args:"+args.get("loop")); 43 | createView(context, args); 44 | initChannel(messenger, viewId); 45 | this.viewId = viewId; 46 | } 47 | 48 | 49 | private void createView(Context context, HashMap args) { 50 | aliListPlayer = AliPlayerFactory.createAliListPlayer(context); 51 | aliListPlayer.setOnStateChangedListener(this); 52 | aliListPlayer.setOnPreparedListener(this); 53 | aliListPlayer.setOnInfoListener(this); 54 | aliListPlayer.setOnErrorListener(this); 55 | aliListPlayer.setOnVideoSizeChangedListener(this); 56 | aliListPlayer.setPreloadCount(5); 57 | aliListPlayer.setAutoPlay(true); 58 | aliListPlayer.setScaleMode(IPlayer.ScaleMode.SCALE_TO_FILL); 59 | boolean loop = (boolean) args.get("loop"); 60 | boolean auto = (boolean) args.get("auto"); 61 | aliListPlayer.setLoop(loop); 62 | aliListPlayer.setAutoPlay(auto); 63 | 64 | 65 | HashMap map = (HashMap) args.get("cacheConfig"); 66 | cacheConfig = new CacheConfig(); 67 | //开启缓存功能 68 | cacheConfig.mEnable = true; 69 | //能够缓存的单个文件最a大时长。超过此长度则不缓存 70 | assert map != null; 71 | BigDecimal b = new BigDecimal((int)map.get("maxDuration")); 72 | cacheConfig.mMaxDurationS = b.longValue(); 73 | cacheConfig.mMaxSizeMB = (int) map.get("maxSizeMB"); 74 | cacheConfig.mDir = (String) map.get("path"); 75 | aliListPlayer.setCacheConfig(cacheConfig); 76 | PlayerConfig config = aliListPlayer.getConfig(); 77 | //设置网络超时时间,单位ms 78 | config.mNetworkTimeout = 5000; 79 | //设置超时重试次数。每次重试间隔为networkTimeout。networkRetryCount=0则表示不重试,重试策略app决定,默认值为2 80 | config.mNetworkRetryCount = 2; 81 | surfaceView = new SurfaceView(context); 82 | surfaceView.getHolder().addCallback(new SurfaceHolder.Callback() { 83 | @Override 84 | public void surfaceCreated(SurfaceHolder surfaceHolder) { 85 | aliListPlayer.setDisplay(surfaceHolder); 86 | } 87 | 88 | @Override 89 | public void surfaceChanged(SurfaceHolder surfaceHolder, int i, int i1, int i2) { 90 | aliListPlayer.redraw(); 91 | } 92 | 93 | @Override 94 | public void surfaceDestroyed(SurfaceHolder surfaceHolder) { 95 | aliListPlayer.setDisplay(null); 96 | } 97 | }); 98 | aliListPlayer.prepare(); 99 | } 100 | 101 | private void initChannel(BinaryMessenger messenger, int viewId) { 102 | this.methodChannel = new MethodChannel(messenger, "plugin.iqingbai.com/ali_video_play_" + viewId); 103 | this.eventChannel = new EventChannel(messenger, "plugin.iqingbai.com/eventChannel/ali_video_play_" + viewId); 104 | eventChannel.setStreamHandler(new EventChannel.StreamHandler() { 105 | @Override 106 | public void onListen(Object arguments, EventChannel.EventSink events) { 107 | eventSink = events; 108 | } 109 | 110 | @Override 111 | public void onCancel(Object arguments) { 112 | eventSink = null; 113 | } 114 | }); 115 | methodChannel.setMethodCallHandler(this); 116 | 117 | } 118 | 119 | @Override 120 | public View getView() { 121 | return surfaceView; 122 | } 123 | 124 | @Override 125 | public void dispose() { 126 | methodChannel = null; 127 | eventChannel = null; 128 | } 129 | 130 | @Override 131 | public void onMethodCall(@NonNull MethodCall call, @NonNull MethodChannel.Result result) { 132 | System.out.println("call:" + call.method); 133 | switch (call.method) { 134 | case "addUrlSource": 135 | List list = call.argument("urls"); 136 | if (list != null) { 137 | for (int i = 0; i < list.size(); i++) { 138 | aliListPlayer.addUrl(list.get(i), list.get(i)); 139 | } 140 | } 141 | result.success(null); 142 | break; 143 | case "start": 144 | aliListPlayer.start(); 145 | result.success(null); 146 | break; 147 | case "pause": 148 | aliListPlayer.pause(); 149 | result.success(null); 150 | break; 151 | case "stop": 152 | aliListPlayer.stop(); 153 | result.success(null); 154 | break; 155 | case "setMute": 156 | aliListPlayer.setMute((Boolean) call.argument("mute")); 157 | result.success(null); 158 | break; 159 | case "moveTo": 160 | String url = call.argument("url"); 161 | aliListPlayer.moveTo(url); 162 | result.success(null); 163 | break; 164 | case "moveToNext": 165 | aliListPlayer.moveToNext(); 166 | result.success(null); 167 | break; 168 | case "moveToPre": 169 | aliListPlayer.moveToPrev(); 170 | result.success(null); 171 | break; 172 | case "seekTo": 173 | int position = call.argument("position"); 174 | BigDecimal b = new BigDecimal(position); 175 | aliListPlayer.seekTo(b.longValue()); 176 | result.success(null); 177 | break; 178 | case "setScalingMode": 179 | int a = (int) call.argument("mode"); 180 | switch (a) { 181 | case 1: 182 | aliListPlayer.setScaleMode(IPlayer.ScaleMode.SCALE_ASPECT_FIT); 183 | break; 184 | case 2: 185 | aliListPlayer.setScaleMode(IPlayer.ScaleMode.SCALE_ASPECT_FILL); 186 | break; 187 | case 0: 188 | aliListPlayer.setScaleMode(IPlayer.ScaleMode.SCALE_TO_FILL); 189 | break; 190 | } 191 | result.success(null); 192 | break; 193 | case "getCachesPath": 194 | result.success(aliListPlayer.getCacheFilePath((String) call.argument("url"))); 195 | break; 196 | 197 | 198 | // case "setAutoPlay": 199 | // aliListPlayer.setAutoPlay((boolean) call.argument("auto")); 200 | // result.success(null); 201 | // break; 202 | } 203 | 204 | } 205 | 206 | @Override 207 | public void onStateChanged(int i) { 208 | if (eventSink != null) { 209 | HashMap map = new HashMap<>(); 210 | map.put("eventType", "onPlayerStatusChanged"); 211 | map.put("values", i); 212 | eventSink.success(map); 213 | } 214 | } 215 | 216 | @Override 217 | public void onPrepared() { 218 | if (eventSink != null) { 219 | HashMap map = new HashMap<>(); 220 | map.put("eventType", "onPrepared"); 221 | eventSink.success(map); 222 | } 223 | } 224 | /* Unknown(-1), 225 | LoopingStart(0), 226 | BufferedPosition(1), 227 | CurrentPosition(2), 228 | AutoPlayStart(3), 229 | SwitchToSoftwareVideoDecoder(100), 230 | AudioCodecNotSupport(101), 231 | AudioDecoderDeviceError(102), 232 | VideoCodecNotSupport(103), 233 | VideoDecoderDeviceError(104), 234 | NetworkRetry(107), 235 | CacheSuccess(108), 236 | CacheError(109), 237 | LowMemory(110); */ 238 | 239 | @Override 240 | public void onInfo(InfoBean infoBean) { 241 | HashMap map = new HashMap<>(); 242 | switch (infoBean.getCode().getValue()) { 243 | case 1: 244 | map.put("eventType", "onBufferedPositionUpdate"); 245 | map.put("values", infoBean.getExtraValue()); 246 | eventSink.success(map); 247 | break; 248 | case 2: 249 | map.put("eventType", "onCurrentPositionUpdate"); 250 | map.put("values", infoBean.getExtraValue()); 251 | eventSink.success(map); 252 | break; 253 | } 254 | } 255 | 256 | @Override 257 | public void onError(ErrorInfo errorInfo) { 258 | if (eventSink != null) { 259 | HashMap map = new HashMap<>(); 260 | map.put("eventType", "onError"); 261 | map.put("msg", errorInfo.getMsg()); 262 | map.put("errorCode", errorInfo.getCode()); 263 | eventSink.success(map); 264 | } 265 | } 266 | 267 | 268 | @Override 269 | public void onVideoSizeChanged(int i, int i1) { 270 | if (eventSink != null) { 271 | HashMap map = new HashMap<>(); 272 | map.put("eventType", "onVideoSizeChanged"); 273 | map.put("width", i); 274 | map.put("height", i1); 275 | eventSink.success(map); 276 | } 277 | } 278 | } 279 | -------------------------------------------------------------------------------- /android/src/main/java/com/iqingbai/faliplayer/FaliplayerPlugin.java: -------------------------------------------------------------------------------- 1 | package com.iqingbai.faliplayer; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import io.flutter.embedding.engine.plugins.FlutterPlugin; 6 | import io.flutter.plugin.common.MethodCall; 7 | import io.flutter.plugin.common.MethodChannel.MethodCallHandler; 8 | import io.flutter.plugin.common.MethodChannel.Result; 9 | 10 | 11 | public class FaliplayerPlugin implements FlutterPlugin, MethodCallHandler { 12 | 13 | public FaliplayerPlugin() { 14 | } 15 | 16 | @Override 17 | public void onAttachedToEngine(@NonNull FlutterPluginBinding flutterPluginBinding) { 18 | flutterPluginBinding.getPlatformViewRegistry().registerViewFactory("plugin.iqingbai.com/ali_video_play", new ShareFAliPlayerFactory(flutterPluginBinding.getBinaryMessenger())); 19 | flutterPluginBinding.getPlatformViewRegistry().registerViewFactory("plugin.iqingbai.com/ali_video_play_single_", new ShareFAliSinglePlayerFactory(flutterPluginBinding.getBinaryMessenger())); 20 | } 21 | 22 | 23 | @Override 24 | public void onMethodCall(@NonNull MethodCall call, @NonNull Result result) { 25 | // 26 | if (call.method.equals("getPlatformVersion")) { 27 | result.success("Android " + android.os.Build.VERSION.RELEASE); 28 | } else { 29 | result.notImplemented(); 30 | } 31 | } 32 | 33 | @Override 34 | public void onDetachedFromEngine(@NonNull FlutterPluginBinding binding) { 35 | 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /android/src/main/java/com/iqingbai/faliplayer/ShareFAliPlayerFactory.java: -------------------------------------------------------------------------------- 1 | package com.iqingbai.faliplayer; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | import android.support.annotation.RequiresApi; 6 | 7 | import java.util.HashMap; 8 | 9 | import io.flutter.plugin.common.BinaryMessenger; 10 | import io.flutter.plugin.common.StandardMessageCodec; 11 | import io.flutter.plugin.platform.PlatformView; 12 | import io.flutter.plugin.platform.PlatformViewFactory; 13 | 14 | public class ShareFAliPlayerFactory extends PlatformViewFactory { 15 | private BinaryMessenger messenger; 16 | private FAliPlayerTextureView fAliPlayerTextureView; 17 | 18 | ShareFAliPlayerFactory(BinaryMessenger messenger) { 19 | super(StandardMessageCodec.INSTANCE); 20 | this.messenger = messenger; 21 | } 22 | 23 | @RequiresApi(api = Build.VERSION_CODES.O) 24 | @Override 25 | public PlatformView create(Context context, int viewId, Object args) { 26 | if (fAliPlayerTextureView == null) 27 | fAliPlayerTextureView = new FAliPlayerTextureView(context, messenger, (HashMap) args, viewId); 28 | return fAliPlayerTextureView; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /android/src/main/java/com/iqingbai/faliplayer/ShareFAliSinglePlayerFactory.java: -------------------------------------------------------------------------------- 1 | package com.iqingbai.faliplayer; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | import android.support.annotation.RequiresApi; 6 | 7 | import java.util.HashMap; 8 | 9 | import io.flutter.plugin.common.BinaryMessenger; 10 | import io.flutter.plugin.common.StandardMessageCodec; 11 | import io.flutter.plugin.platform.PlatformView; 12 | import io.flutter.plugin.platform.PlatformViewFactory; 13 | 14 | public class ShareFAliSinglePlayerFactory extends PlatformViewFactory { 15 | private BinaryMessenger messenger; 16 | private FAliPlayerSingleTextureView fAliPlayerSingleTextureView; 17 | 18 | ShareFAliSinglePlayerFactory(BinaryMessenger messenger) { 19 | super(StandardMessageCodec.INSTANCE); 20 | this.messenger = messenger; 21 | } 22 | 23 | @RequiresApi(api = Build.VERSION_CODES.O) 24 | @Override 25 | public PlatformView create(Context context, int viewId, Object args) { 26 | fAliPlayerSingleTextureView = new FAliPlayerSingleTextureView(context, messenger, (HashMap) args, viewId); 27 | return fAliPlayerSingleTextureView; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /example/.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 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Exceptions to above rules. 37 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 38 | -------------------------------------------------------------------------------- /example/.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: 0b8abb4724aa590dd0f429683339b1e045a1594d 8 | channel: stable 9 | 10 | project_type: app 11 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # faliplayer_example 2 | 3 | Demonstrates how to use the faliplayer plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) 13 | 14 | For help getting started with Flutter, view our 15 | [online documentation](https://flutter.dev/docs), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | -------------------------------------------------------------------------------- /example/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 "com.iqingbai.faliplayer_example" 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 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 8 | 12 | 19 | 20 | 21 | 22 | 23 | 24 | 26 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/iqingbai/faliplayer_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.iqingbai.faliplayer_example; 2 | 3 | import android.support.annotation.NonNull; 4 | import io.flutter.embedding.android.FlutterActivity; 5 | import io.flutter.embedding.engine.FlutterEngine; 6 | import io.flutter.plugins.GeneratedPluginRegistrant; 7 | 8 | public class MainActivity extends FlutterActivity { 9 | @Override 10 | public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { 11 | GeneratedPluginRegistrant.registerWith(flutterEngine); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 9 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | google() 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:3.5.0' 9 | } 10 | } 11 | 12 | allprojects { 13 | repositories { 14 | google() 15 | jcenter() 16 | } 17 | } 18 | 19 | rootProject.buildDir = '../build' 20 | subprojects { 21 | project.buildDir = "${rootProject.buildDir}/${project.name}" 22 | } 23 | subprojects { 24 | project.evaluationDependsOn(':app') 25 | } 26 | 27 | task clean(type: Delete) { 28 | delete rootProject.buildDir 29 | } 30 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | android.enableR8=true 3 | -------------------------------------------------------------------------------- /example/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-5.6.2-all.zip 7 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | *.mode1v3 2 | *.mode2v3 3 | *.moved-aside 4 | *.pbxuser 5 | *.perspectivev3 6 | **/*sync/ 7 | .sconsign.dblite 8 | .tags* 9 | **/.vagrant/ 10 | **/DerivedData/ 11 | Icon? 12 | **/Pods/ 13 | **/.symlinks/ 14 | profile 15 | xcuserdata 16 | **/.generated/ 17 | Flutter/App.framework 18 | Flutter/Flutter.framework 19 | Flutter/Flutter.podspec 20 | Flutter/Generated.xcconfig 21 | Flutter/app.flx 22 | Flutter/app.zip 23 | Flutter/flutter_assets/ 24 | Flutter/flutter_export_environment.sh 25 | ServiceDefinitions.json 26 | Runner/GeneratedPluginRegistrant.* 27 | 28 | # Exceptions to above rules. 29 | !default.mode1v3 30 | !default.mode2v3 31 | !default.pbxuser 32 | !default.perspectivev3 33 | -------------------------------------------------------------------------------- /example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 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 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | # platform :ios, '9.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def parse_KV_file(file, separator='=') 14 | file_abs_path = File.expand_path(file) 15 | if !File.exists? file_abs_path 16 | return []; 17 | end 18 | generated_key_values = {} 19 | skip_line_start_symbols = ["#", "/"] 20 | File.foreach(file_abs_path) do |line| 21 | next if skip_line_start_symbols.any? { |symbol| line =~ /^\s*#{symbol}/ } 22 | plugin = line.split(pattern=separator) 23 | if plugin.length == 2 24 | podname = plugin[0].strip() 25 | path = plugin[1].strip() 26 | podpath = File.expand_path("#{path}", file_abs_path) 27 | generated_key_values[podname] = podpath 28 | else 29 | puts "Invalid plugin specification: #{line}" 30 | end 31 | end 32 | generated_key_values 33 | end 34 | 35 | target 'Runner' do 36 | # Flutter Pod 37 | 38 | copied_flutter_dir = File.join(__dir__, 'Flutter') 39 | copied_framework_path = File.join(copied_flutter_dir, 'Flutter.framework') 40 | copied_podspec_path = File.join(copied_flutter_dir, 'Flutter.podspec') 41 | unless File.exist?(copied_framework_path) && File.exist?(copied_podspec_path) 42 | # Copy Flutter.framework and Flutter.podspec to Flutter/ to have something to link against if the xcode backend script has not run yet. 43 | # That script will copy the correct debug/profile/release version of the framework based on the currently selected Xcode configuration. 44 | # CocoaPods will not embed the framework on pod install (before any build phases can generate) if the dylib does not exist. 45 | 46 | generated_xcode_build_settings_path = File.join(copied_flutter_dir, 'Generated.xcconfig') 47 | unless File.exist?(generated_xcode_build_settings_path) 48 | raise "Generated.xcconfig must exist. If you're running pod install manually, make sure flutter pub get is executed first" 49 | end 50 | generated_xcode_build_settings = parse_KV_file(generated_xcode_build_settings_path) 51 | cached_framework_dir = generated_xcode_build_settings['FLUTTER_FRAMEWORK_DIR']; 52 | 53 | unless File.exist?(copied_framework_path) 54 | FileUtils.cp_r(File.join(cached_framework_dir, 'Flutter.framework'), copied_flutter_dir) 55 | end 56 | unless File.exist?(copied_podspec_path) 57 | FileUtils.cp(File.join(cached_framework_dir, 'Flutter.podspec'), copied_flutter_dir) 58 | end 59 | end 60 | 61 | # Keep pod path relative so it can be checked into Podfile.lock. 62 | pod 'Flutter', :path => 'Flutter' 63 | 64 | # Plugin Pods 65 | 66 | # Prepare symlinks folder. We use symlinks to avoid having Podfile.lock 67 | # referring to absolute paths on developers' machines. 68 | system('rm -rf .symlinks') 69 | system('mkdir -p .symlinks/plugins') 70 | plugin_pods = parse_KV_file('../.flutter-plugins') 71 | plugin_pods.each do |name, path| 72 | symlink = File.join('.symlinks', 'plugins', name) 73 | File.symlink(path, symlink) 74 | pod name, :path => File.join(symlink, 'ios') 75 | end 76 | end 77 | 78 | # Prevent Cocoapods from embedding a second Flutter framework and causing an error with the new Xcode build system. 79 | install! 'cocoapods', :disable_input_output_paths => true 80 | 81 | post_install do |installer| 82 | installer.pods_project.targets.each do |target| 83 | target.build_configurations.each do |config| 84 | config.build_settings['ENABLE_BITCODE'] = 'NO' 85 | end 86 | end 87 | end 88 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AliPlayerSDK_iOS (5.1.0): 3 | - AliPlayerSDK_iOS/AliPlayerSDK (= 5.1.0) 4 | - AliPlayerSDK_iOS/AliPlayerSDK (5.1.0) 5 | - faliplayer (0.0.1): 6 | - AliPlayerSDK_iOS 7 | - Flutter 8 | - Flutter (1.0.0) 9 | - path_provider (0.0.1): 10 | - Flutter 11 | - path_provider_macos (0.0.1): 12 | - Flutter 13 | 14 | DEPENDENCIES: 15 | - faliplayer (from `.symlinks/plugins/faliplayer/ios`) 16 | - Flutter (from `Flutter`) 17 | - path_provider (from `.symlinks/plugins/path_provider/ios`) 18 | - path_provider_macos (from `.symlinks/plugins/path_provider_macos/ios`) 19 | 20 | SPEC REPOS: 21 | trunk: 22 | - AliPlayerSDK_iOS 23 | 24 | EXTERNAL SOURCES: 25 | faliplayer: 26 | :path: ".symlinks/plugins/faliplayer/ios" 27 | Flutter: 28 | :path: Flutter 29 | path_provider: 30 | :path: ".symlinks/plugins/path_provider/ios" 31 | path_provider_macos: 32 | :path: ".symlinks/plugins/path_provider_macos/ios" 33 | 34 | SPEC CHECKSUMS: 35 | AliPlayerSDK_iOS: 7377cfbe36b97629e4f4a19884ed9c28636d08fd 36 | faliplayer: aac943156488038d574491a66e8b53d1370ff4d1 37 | Flutter: 0e3d915762c693b495b44d77113d4970485de6ec 38 | path_provider: fb74bd0465e96b594bb3b5088ee4a4e7bb1f2a9d 39 | path_provider_macos: f760a3c5b04357c380e2fddb6f9db6f3015897e0 40 | 41 | PODFILE CHECKSUM: 3dbe063e9c90a5d7c9e4e76e70a821b9e2c1d271 42 | 43 | COCOAPODS: 1.8.4 44 | -------------------------------------------------------------------------------- /example/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 | 00F7512FB2A5EE790F3747E0 /* libPods-Runner.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 168D6663C250FE4377FE6EA5 /* libPods-Runner.a */; }; 11 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 12 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 13 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; }; 14 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 3B80C3931E831B6300D905FE /* App.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 15 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; }; 16 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9740EEBA1CF902C7004384FC /* Flutter.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 17 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */; }; 18 | 97C146F31CF9000F007C117D /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 97C146F21CF9000F007C117D /* main.m */; }; 19 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 20 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 21 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXCopyFilesBuildPhase section */ 25 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 26 | isa = PBXCopyFilesBuildPhase; 27 | buildActionMask = 2147483647; 28 | dstPath = ""; 29 | dstSubfolderSpec = 10; 30 | files = ( 31 | 3B80C3951E831B6300D905FE /* App.framework in Embed Frameworks */, 32 | 9705A1C71CF904A300538489 /* Flutter.framework in Embed Frameworks */, 33 | ); 34 | name = "Embed Frameworks"; 35 | runOnlyForDeploymentPostprocessing = 0; 36 | }; 37 | /* End PBXCopyFilesBuildPhase section */ 38 | 39 | /* Begin PBXFileReference section */ 40 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 41 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 42 | 168D6663C250FE4377FE6EA5 /* libPods-Runner.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-Runner.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 43 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 44 | 3B80C3931E831B6300D905FE /* App.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = App.framework; path = Flutter/App.framework; sourceTree = ""; }; 45 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 46 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 47 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 48 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 49 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 50 | 9740EEBA1CF902C7004384FC /* Flutter.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Flutter.framework; path = Flutter/Flutter.framework; sourceTree = ""; }; 51 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | 97C146F21CF9000F007C117D /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 53 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 54 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 55 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 56 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 57 | D3C75ABEBFDD6950584961FF /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 58 | F0B1AB502EAA302C3ADD3212 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 59 | FB56778ADC27EE55C6DC2F24 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 60 | /* End PBXFileReference section */ 61 | 62 | /* Begin PBXFrameworksBuildPhase section */ 63 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 64 | isa = PBXFrameworksBuildPhase; 65 | buildActionMask = 2147483647; 66 | files = ( 67 | 9705A1C61CF904A100538489 /* Flutter.framework in Frameworks */, 68 | 3B80C3941E831B6300D905FE /* App.framework in Frameworks */, 69 | 00F7512FB2A5EE790F3747E0 /* libPods-Runner.a in Frameworks */, 70 | ); 71 | runOnlyForDeploymentPostprocessing = 0; 72 | }; 73 | /* End PBXFrameworksBuildPhase section */ 74 | 75 | /* Begin PBXGroup section */ 76 | 45268F8A9224D8AC92FC9978 /* Frameworks */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 168D6663C250FE4377FE6EA5 /* libPods-Runner.a */, 80 | ); 81 | name = Frameworks; 82 | sourceTree = ""; 83 | }; 84 | 95E95969D5FE1D4D2AC03C4C /* Pods */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | FB56778ADC27EE55C6DC2F24 /* Pods-Runner.debug.xcconfig */, 88 | D3C75ABEBFDD6950584961FF /* Pods-Runner.release.xcconfig */, 89 | F0B1AB502EAA302C3ADD3212 /* Pods-Runner.profile.xcconfig */, 90 | ); 91 | path = Pods; 92 | sourceTree = ""; 93 | }; 94 | 9740EEB11CF90186004384FC /* Flutter */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 3B80C3931E831B6300D905FE /* App.framework */, 98 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 99 | 9740EEBA1CF902C7004384FC /* Flutter.framework */, 100 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 101 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 102 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 103 | ); 104 | name = Flutter; 105 | sourceTree = ""; 106 | }; 107 | 97C146E51CF9000F007C117D = { 108 | isa = PBXGroup; 109 | children = ( 110 | 9740EEB11CF90186004384FC /* Flutter */, 111 | 97C146F01CF9000F007C117D /* Runner */, 112 | 97C146EF1CF9000F007C117D /* Products */, 113 | 95E95969D5FE1D4D2AC03C4C /* Pods */, 114 | 45268F8A9224D8AC92FC9978 /* Frameworks */, 115 | ); 116 | sourceTree = ""; 117 | }; 118 | 97C146EF1CF9000F007C117D /* Products */ = { 119 | isa = PBXGroup; 120 | children = ( 121 | 97C146EE1CF9000F007C117D /* Runner.app */, 122 | ); 123 | name = Products; 124 | sourceTree = ""; 125 | }; 126 | 97C146F01CF9000F007C117D /* Runner */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 7AFFD8ED1D35381100E5BB4D /* AppDelegate.h */, 130 | 7AFFD8EE1D35381100E5BB4D /* AppDelegate.m */, 131 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 132 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 133 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 134 | 97C147021CF9000F007C117D /* Info.plist */, 135 | 97C146F11CF9000F007C117D /* Supporting Files */, 136 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 137 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 138 | ); 139 | path = Runner; 140 | sourceTree = ""; 141 | }; 142 | 97C146F11CF9000F007C117D /* Supporting Files */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 97C146F21CF9000F007C117D /* main.m */, 146 | ); 147 | name = "Supporting Files"; 148 | sourceTree = ""; 149 | }; 150 | /* End PBXGroup section */ 151 | 152 | /* Begin PBXNativeTarget section */ 153 | 97C146ED1CF9000F007C117D /* Runner */ = { 154 | isa = PBXNativeTarget; 155 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 156 | buildPhases = ( 157 | 39E23C653EB46F1BA846CE03 /* [CP] Check Pods Manifest.lock */, 158 | 9740EEB61CF901F6004384FC /* Run Script */, 159 | 97C146EA1CF9000F007C117D /* Sources */, 160 | 97C146EB1CF9000F007C117D /* Frameworks */, 161 | 97C146EC1CF9000F007C117D /* Resources */, 162 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 163 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 164 | 6911663C1D6B7AB9016F3D68 /* [CP] Embed Pods Frameworks */, 165 | ); 166 | buildRules = ( 167 | ); 168 | dependencies = ( 169 | ); 170 | name = Runner; 171 | productName = Runner; 172 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 173 | productType = "com.apple.product-type.application"; 174 | }; 175 | /* End PBXNativeTarget section */ 176 | 177 | /* Begin PBXProject section */ 178 | 97C146E61CF9000F007C117D /* Project object */ = { 179 | isa = PBXProject; 180 | attributes = { 181 | LastUpgradeCheck = 1020; 182 | ORGANIZATIONNAME = "The Chromium Authors"; 183 | TargetAttributes = { 184 | 97C146ED1CF9000F007C117D = { 185 | CreatedOnToolsVersion = 7.3.1; 186 | DevelopmentTeam = DNP3U5GLWP; 187 | }; 188 | }; 189 | }; 190 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 191 | compatibilityVersion = "Xcode 3.2"; 192 | developmentRegion = en; 193 | hasScannedForEncodings = 0; 194 | knownRegions = ( 195 | en, 196 | Base, 197 | ); 198 | mainGroup = 97C146E51CF9000F007C117D; 199 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 200 | projectDirPath = ""; 201 | projectRoot = ""; 202 | targets = ( 203 | 97C146ED1CF9000F007C117D /* Runner */, 204 | ); 205 | }; 206 | /* End PBXProject section */ 207 | 208 | /* Begin PBXResourcesBuildPhase section */ 209 | 97C146EC1CF9000F007C117D /* Resources */ = { 210 | isa = PBXResourcesBuildPhase; 211 | buildActionMask = 2147483647; 212 | files = ( 213 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 214 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 215 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 216 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 217 | ); 218 | runOnlyForDeploymentPostprocessing = 0; 219 | }; 220 | /* End PBXResourcesBuildPhase section */ 221 | 222 | /* Begin PBXShellScriptBuildPhase section */ 223 | 39E23C653EB46F1BA846CE03 /* [CP] Check Pods Manifest.lock */ = { 224 | isa = PBXShellScriptBuildPhase; 225 | buildActionMask = 2147483647; 226 | files = ( 227 | ); 228 | inputFileListPaths = ( 229 | ); 230 | inputPaths = ( 231 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 232 | "${PODS_ROOT}/Manifest.lock", 233 | ); 234 | name = "[CP] Check Pods Manifest.lock"; 235 | outputFileListPaths = ( 236 | ); 237 | outputPaths = ( 238 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 239 | ); 240 | runOnlyForDeploymentPostprocessing = 0; 241 | shellPath = /bin/sh; 242 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 243 | showEnvVarsInLog = 0; 244 | }; 245 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 246 | isa = PBXShellScriptBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | ); 250 | inputPaths = ( 251 | ); 252 | name = "Thin Binary"; 253 | outputPaths = ( 254 | ); 255 | runOnlyForDeploymentPostprocessing = 0; 256 | shellPath = /bin/sh; 257 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" thin"; 258 | }; 259 | 6911663C1D6B7AB9016F3D68 /* [CP] Embed Pods Frameworks */ = { 260 | isa = PBXShellScriptBuildPhase; 261 | buildActionMask = 2147483647; 262 | files = ( 263 | ); 264 | inputPaths = ( 265 | ); 266 | name = "[CP] Embed Pods Frameworks"; 267 | outputPaths = ( 268 | ); 269 | runOnlyForDeploymentPostprocessing = 0; 270 | shellPath = /bin/sh; 271 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; 272 | showEnvVarsInLog = 0; 273 | }; 274 | 9740EEB61CF901F6004384FC /* Run Script */ = { 275 | isa = PBXShellScriptBuildPhase; 276 | buildActionMask = 2147483647; 277 | files = ( 278 | ); 279 | inputPaths = ( 280 | ); 281 | name = "Run Script"; 282 | outputPaths = ( 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | shellPath = /bin/sh; 286 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 287 | }; 288 | /* End PBXShellScriptBuildPhase section */ 289 | 290 | /* Begin PBXSourcesBuildPhase section */ 291 | 97C146EA1CF9000F007C117D /* Sources */ = { 292 | isa = PBXSourcesBuildPhase; 293 | buildActionMask = 2147483647; 294 | files = ( 295 | 978B8F6F1D3862AE00F588F7 /* AppDelegate.m in Sources */, 296 | 97C146F31CF9000F007C117D /* main.m in Sources */, 297 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 298 | ); 299 | runOnlyForDeploymentPostprocessing = 0; 300 | }; 301 | /* End PBXSourcesBuildPhase section */ 302 | 303 | /* Begin PBXVariantGroup section */ 304 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 305 | isa = PBXVariantGroup; 306 | children = ( 307 | 97C146FB1CF9000F007C117D /* Base */, 308 | ); 309 | name = Main.storyboard; 310 | sourceTree = ""; 311 | }; 312 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 313 | isa = PBXVariantGroup; 314 | children = ( 315 | 97C147001CF9000F007C117D /* Base */, 316 | ); 317 | name = LaunchScreen.storyboard; 318 | sourceTree = ""; 319 | }; 320 | /* End PBXVariantGroup section */ 321 | 322 | /* Begin XCBuildConfiguration section */ 323 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 324 | isa = XCBuildConfiguration; 325 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 326 | buildSettings = { 327 | ALWAYS_SEARCH_USER_PATHS = NO; 328 | CLANG_ANALYZER_NONNULL = YES; 329 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 330 | CLANG_CXX_LIBRARY = "libc++"; 331 | CLANG_ENABLE_MODULES = YES; 332 | CLANG_ENABLE_OBJC_ARC = YES; 333 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 334 | CLANG_WARN_BOOL_CONVERSION = YES; 335 | CLANG_WARN_COMMA = YES; 336 | CLANG_WARN_CONSTANT_CONVERSION = YES; 337 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 338 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 339 | CLANG_WARN_EMPTY_BODY = YES; 340 | CLANG_WARN_ENUM_CONVERSION = YES; 341 | CLANG_WARN_INFINITE_RECURSION = YES; 342 | CLANG_WARN_INT_CONVERSION = YES; 343 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 344 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 345 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 346 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 347 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 348 | CLANG_WARN_STRICT_PROTOTYPES = YES; 349 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 350 | CLANG_WARN_UNREACHABLE_CODE = YES; 351 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 352 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 353 | COPY_PHASE_STRIP = NO; 354 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 355 | ENABLE_NS_ASSERTIONS = NO; 356 | ENABLE_STRICT_OBJC_MSGSEND = YES; 357 | GCC_C_LANGUAGE_STANDARD = gnu99; 358 | GCC_NO_COMMON_BLOCKS = YES; 359 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 360 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 361 | GCC_WARN_UNDECLARED_SELECTOR = YES; 362 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 363 | GCC_WARN_UNUSED_FUNCTION = YES; 364 | GCC_WARN_UNUSED_VARIABLE = YES; 365 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 366 | MTL_ENABLE_DEBUG_INFO = NO; 367 | SDKROOT = iphoneos; 368 | SUPPORTED_PLATFORMS = iphoneos; 369 | TARGETED_DEVICE_FAMILY = "1,2"; 370 | VALIDATE_PRODUCT = YES; 371 | }; 372 | name = Profile; 373 | }; 374 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 375 | isa = XCBuildConfiguration; 376 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 377 | buildSettings = { 378 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 379 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 380 | DEVELOPMENT_TEAM = DNP3U5GLWP; 381 | ENABLE_BITCODE = NO; 382 | FRAMEWORK_SEARCH_PATHS = ( 383 | "$(inherited)", 384 | "$(PROJECT_DIR)/Flutter", 385 | ); 386 | INFOPLIST_FILE = Runner/Info.plist; 387 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 388 | LIBRARY_SEARCH_PATHS = ( 389 | "$(inherited)", 390 | "$(PROJECT_DIR)/Flutter", 391 | ); 392 | PRODUCT_BUNDLE_IDENTIFIER = com.iqingbai.faliplayerExample; 393 | PRODUCT_NAME = "$(TARGET_NAME)"; 394 | VERSIONING_SYSTEM = "apple-generic"; 395 | }; 396 | name = Profile; 397 | }; 398 | 97C147031CF9000F007C117D /* Debug */ = { 399 | isa = XCBuildConfiguration; 400 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 401 | buildSettings = { 402 | ALWAYS_SEARCH_USER_PATHS = NO; 403 | CLANG_ANALYZER_NONNULL = YES; 404 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 405 | CLANG_CXX_LIBRARY = "libc++"; 406 | CLANG_ENABLE_MODULES = YES; 407 | CLANG_ENABLE_OBJC_ARC = YES; 408 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 409 | CLANG_WARN_BOOL_CONVERSION = YES; 410 | CLANG_WARN_COMMA = YES; 411 | CLANG_WARN_CONSTANT_CONVERSION = YES; 412 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 413 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 414 | CLANG_WARN_EMPTY_BODY = YES; 415 | CLANG_WARN_ENUM_CONVERSION = YES; 416 | CLANG_WARN_INFINITE_RECURSION = YES; 417 | CLANG_WARN_INT_CONVERSION = YES; 418 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 419 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 420 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 421 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 422 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 423 | CLANG_WARN_STRICT_PROTOTYPES = YES; 424 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 425 | CLANG_WARN_UNREACHABLE_CODE = YES; 426 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 427 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 428 | COPY_PHASE_STRIP = NO; 429 | DEBUG_INFORMATION_FORMAT = dwarf; 430 | ENABLE_STRICT_OBJC_MSGSEND = YES; 431 | ENABLE_TESTABILITY = YES; 432 | GCC_C_LANGUAGE_STANDARD = gnu99; 433 | GCC_DYNAMIC_NO_PIC = NO; 434 | GCC_NO_COMMON_BLOCKS = YES; 435 | GCC_OPTIMIZATION_LEVEL = 0; 436 | GCC_PREPROCESSOR_DEFINITIONS = ( 437 | "DEBUG=1", 438 | "$(inherited)", 439 | ); 440 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 441 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 442 | GCC_WARN_UNDECLARED_SELECTOR = YES; 443 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 444 | GCC_WARN_UNUSED_FUNCTION = YES; 445 | GCC_WARN_UNUSED_VARIABLE = YES; 446 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 447 | MTL_ENABLE_DEBUG_INFO = YES; 448 | ONLY_ACTIVE_ARCH = YES; 449 | SDKROOT = iphoneos; 450 | TARGETED_DEVICE_FAMILY = "1,2"; 451 | }; 452 | name = Debug; 453 | }; 454 | 97C147041CF9000F007C117D /* Release */ = { 455 | isa = XCBuildConfiguration; 456 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 457 | buildSettings = { 458 | ALWAYS_SEARCH_USER_PATHS = NO; 459 | CLANG_ANALYZER_NONNULL = YES; 460 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 461 | CLANG_CXX_LIBRARY = "libc++"; 462 | CLANG_ENABLE_MODULES = YES; 463 | CLANG_ENABLE_OBJC_ARC = YES; 464 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 465 | CLANG_WARN_BOOL_CONVERSION = YES; 466 | CLANG_WARN_COMMA = YES; 467 | CLANG_WARN_CONSTANT_CONVERSION = YES; 468 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 469 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 470 | CLANG_WARN_EMPTY_BODY = YES; 471 | CLANG_WARN_ENUM_CONVERSION = YES; 472 | CLANG_WARN_INFINITE_RECURSION = YES; 473 | CLANG_WARN_INT_CONVERSION = YES; 474 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 475 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 476 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 477 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 478 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 479 | CLANG_WARN_STRICT_PROTOTYPES = YES; 480 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 481 | CLANG_WARN_UNREACHABLE_CODE = YES; 482 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 483 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 484 | COPY_PHASE_STRIP = NO; 485 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 486 | ENABLE_NS_ASSERTIONS = NO; 487 | ENABLE_STRICT_OBJC_MSGSEND = YES; 488 | GCC_C_LANGUAGE_STANDARD = gnu99; 489 | GCC_NO_COMMON_BLOCKS = YES; 490 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 491 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 492 | GCC_WARN_UNDECLARED_SELECTOR = YES; 493 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 494 | GCC_WARN_UNUSED_FUNCTION = YES; 495 | GCC_WARN_UNUSED_VARIABLE = YES; 496 | IPHONEOS_DEPLOYMENT_TARGET = 8.0; 497 | MTL_ENABLE_DEBUG_INFO = NO; 498 | SDKROOT = iphoneos; 499 | SUPPORTED_PLATFORMS = iphoneos; 500 | TARGETED_DEVICE_FAMILY = "1,2"; 501 | VALIDATE_PRODUCT = YES; 502 | }; 503 | name = Release; 504 | }; 505 | 97C147061CF9000F007C117D /* Debug */ = { 506 | isa = XCBuildConfiguration; 507 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 508 | buildSettings = { 509 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 510 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 511 | DEVELOPMENT_TEAM = DNP3U5GLWP; 512 | ENABLE_BITCODE = NO; 513 | FRAMEWORK_SEARCH_PATHS = ( 514 | "$(inherited)", 515 | "$(PROJECT_DIR)/Flutter", 516 | ); 517 | INFOPLIST_FILE = Runner/Info.plist; 518 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 519 | LIBRARY_SEARCH_PATHS = ( 520 | "$(inherited)", 521 | "$(PROJECT_DIR)/Flutter", 522 | ); 523 | PRODUCT_BUNDLE_IDENTIFIER = com.iqingbai.faliplayerExample; 524 | PRODUCT_NAME = "$(TARGET_NAME)"; 525 | VERSIONING_SYSTEM = "apple-generic"; 526 | }; 527 | name = Debug; 528 | }; 529 | 97C147071CF9000F007C117D /* Release */ = { 530 | isa = XCBuildConfiguration; 531 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 532 | buildSettings = { 533 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 534 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 535 | DEVELOPMENT_TEAM = DNP3U5GLWP; 536 | ENABLE_BITCODE = NO; 537 | FRAMEWORK_SEARCH_PATHS = ( 538 | "$(inherited)", 539 | "$(PROJECT_DIR)/Flutter", 540 | ); 541 | INFOPLIST_FILE = Runner/Info.plist; 542 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 543 | LIBRARY_SEARCH_PATHS = ( 544 | "$(inherited)", 545 | "$(PROJECT_DIR)/Flutter", 546 | ); 547 | PRODUCT_BUNDLE_IDENTIFIER = com.iqingbai.faliplayerExample; 548 | PRODUCT_NAME = "$(TARGET_NAME)"; 549 | VERSIONING_SYSTEM = "apple-generic"; 550 | }; 551 | name = Release; 552 | }; 553 | /* End XCBuildConfiguration section */ 554 | 555 | /* Begin XCConfigurationList section */ 556 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 557 | isa = XCConfigurationList; 558 | buildConfigurations = ( 559 | 97C147031CF9000F007C117D /* Debug */, 560 | 97C147041CF9000F007C117D /* Release */, 561 | 249021D3217E4FDB00AE95B9 /* Profile */, 562 | ); 563 | defaultConfigurationIsVisible = 0; 564 | defaultConfigurationName = Release; 565 | }; 566 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 567 | isa = XCConfigurationList; 568 | buildConfigurations = ( 569 | 97C147061CF9000F007C117D /* Debug */, 570 | 97C147071CF9000F007C117D /* Release */, 571 | 249021D4217E4FDB00AE95B9 /* Profile */, 572 | ); 573 | defaultConfigurationIsVisible = 0; 574 | defaultConfigurationName = Release; 575 | }; 576 | /* End XCConfigurationList section */ 577 | }; 578 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 579 | } 580 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 39 | 40 | 41 | 42 | 43 | 44 | 54 | 56 | 62 | 63 | 64 | 65 | 66 | 67 | 73 | 75 | 81 | 82 | 83 | 84 | 86 | 87 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : FlutterAppDelegate 5 | 6 | @end 7 | -------------------------------------------------------------------------------- /example/ios/Runner/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | #import "GeneratedPluginRegistrant.h" 3 | 4 | @implementation AppDelegate 5 | 6 | - (BOOL)application:(UIApplication *)application 7 | didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 8 | [GeneratedPluginRegistrant registerWithRegistry:self]; 9 | // Override point for customization after application launch. 10 | return [super application:application didFinishLaunchingWithOptions:launchOptions]; 11 | } 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /example/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. -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | faliplayer_example 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | $(FLUTTER_BUILD_NAME) 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | io.flutter.embedded_views_preview 45 | 46 | App Transport Security Settings 47 | 48 | Allow Arbitrary Loads 49 | 50 | 51 | NSAppTransportSecurity 52 | 53 | NSAllowsArbitraryLoads 54 | 55 | 56 | UIBackgroundModes 57 | 58 | 59 | 60 | Item 0 61 | App plays audio or streams audio/video using AirPlay 62 | 63 | 64 | -------------------------------------------------------------------------------- /example/ios/Runner/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char* argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/material.dart'; 2 | 3 | import 'package:faliplayer/faliplayer.dart'; 4 | void main() => runApp(MyApp()); 5 | 6 | class MyApp extends StatefulWidget { 7 | @override 8 | _MyAppState createState() => _MyAppState(); 9 | } 10 | 11 | class _MyAppState extends State { 12 | FAliListPlayerController controller; 13 | bool a = true; 14 | List urls = [ 15 | "http://video.iqingbai.com/202002181038474liyNnnSzz.mp4", 16 | "http://video.iqingbai.com/20200218025702PSiVKDB5ap.mp4", 17 | "http://video.iqingbai.com/v0200f010000bpoujm68qblf351u7kqg.MP4", 18 | "http://video.iqingbai.com/v0200f230000bpoos459688r4f4ktnq0.MP4", 19 | "http://video.iqingbai.com/v0200fd60000bpouklebn5vab8nv6es0.MP4", 20 | "http://video.iqingbai.com/v0200fa00000bpnf14kmavfcq3piinkg.MP4", 21 | "http://video.iqingbai.com/v0200f9a0000bpkr35j2ap9cj5gjvlqg.MP4", 22 | "http://video.iqingbai.com/v0200f8a0000bpou2mnu9qbego7fpu0g.MP4", 23 | "http://video.iqingbai.com/v0200f8a0000bpoth05ds13erv5id0q0.MP4", 24 | "http://video.iqingbai.com/v0200f8a0000bport5nu9qbego7dimhg.MP4", 25 | "http://video.iqingbai.com/v0200f7a0000bpkcgvsuatl02d672cv0.MP4", 26 | "http://video.iqingbai.com/v0200f660000bpo8shqgd9fp1sds10k0.MP4", 27 | "http://video.iqingbai.com/v0200f530000bporepf3cp5e6ui4g5og.MP4", 28 | "http://video.iqingbai.com/v0200f530000bpob7ksm7fic1j4pi090.MP4", 29 | ]; 30 | 31 | @override 32 | void initState() { 33 | super.initState(); 34 | controller = FAliListPlayerController(isAutoPlay: true, loop: true); 35 | controller.addUrls(urls); 36 | controller.setCacheConfig( 37 | AVPCacheConfig(path: "hjhh", maxDuration: 100, maxSizeMB: 1024)); 38 | } 39 | 40 | @override 41 | Widget build(BuildContext context) { 42 | return MaterialApp( 43 | home: Scaffold( 44 | appBar: AppBar( 45 | title: const Text('Plugin example app'), 46 | ), 47 | body: FAliListPlayerView.builder( 48 | controller: controller, 49 | ), 50 | floatingActionButton: FloatingActionButton( 51 | onPressed: () { 52 | print('111111'); 53 | }, 54 | ), 55 | ), 56 | ); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "2.4.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "2.1.3" 60 | cupertino_icons: 61 | dependency: "direct main" 62 | description: 63 | name: cupertino_icons 64 | url: "https://pub.flutter-io.cn" 65 | source: hosted 66 | version: "0.1.3" 67 | faliplayer: 68 | dependency: "direct dev" 69 | description: 70 | path: ".." 71 | relative: true 72 | source: path 73 | version: "1.0.0" 74 | flutter: 75 | dependency: "direct main" 76 | description: flutter 77 | source: sdk 78 | version: "0.0.0" 79 | flutter_test: 80 | dependency: "direct dev" 81 | description: flutter 82 | source: sdk 83 | version: "0.0.0" 84 | image: 85 | dependency: transitive 86 | description: 87 | name: image 88 | url: "https://pub.flutter-io.cn" 89 | source: hosted 90 | version: "2.1.4" 91 | matcher: 92 | dependency: transitive 93 | description: 94 | name: matcher 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "0.12.6" 98 | meta: 99 | dependency: transitive 100 | description: 101 | name: meta 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "1.1.8" 105 | path: 106 | dependency: "direct main" 107 | description: 108 | name: path 109 | url: "https://pub.flutter-io.cn" 110 | source: hosted 111 | version: "1.6.4" 112 | path_provider: 113 | dependency: "direct main" 114 | description: 115 | name: path_provider 116 | url: "https://pub.flutter-io.cn" 117 | source: hosted 118 | version: "1.6.5" 119 | path_provider_macos: 120 | dependency: transitive 121 | description: 122 | name: path_provider_macos 123 | url: "https://pub.flutter-io.cn" 124 | source: hosted 125 | version: "0.0.4" 126 | path_provider_platform_interface: 127 | dependency: transitive 128 | description: 129 | name: path_provider_platform_interface 130 | url: "https://pub.flutter-io.cn" 131 | source: hosted 132 | version: "1.0.1" 133 | pedantic: 134 | dependency: transitive 135 | description: 136 | name: pedantic 137 | url: "https://pub.flutter-io.cn" 138 | source: hosted 139 | version: "1.8.0+1" 140 | petitparser: 141 | dependency: transitive 142 | description: 143 | name: petitparser 144 | url: "https://pub.flutter-io.cn" 145 | source: hosted 146 | version: "2.4.0" 147 | platform: 148 | dependency: transitive 149 | description: 150 | name: platform 151 | url: "https://pub.flutter-io.cn" 152 | source: hosted 153 | version: "2.2.1" 154 | plugin_platform_interface: 155 | dependency: transitive 156 | description: 157 | name: plugin_platform_interface 158 | url: "https://pub.flutter-io.cn" 159 | source: hosted 160 | version: "1.0.2" 161 | quiver: 162 | dependency: transitive 163 | description: 164 | name: quiver 165 | url: "https://pub.flutter-io.cn" 166 | source: hosted 167 | version: "2.0.5" 168 | sky_engine: 169 | dependency: transitive 170 | description: flutter 171 | source: sdk 172 | version: "0.0.99" 173 | source_span: 174 | dependency: transitive 175 | description: 176 | name: source_span 177 | url: "https://pub.flutter-io.cn" 178 | source: hosted 179 | version: "1.5.5" 180 | stack_trace: 181 | dependency: transitive 182 | description: 183 | name: stack_trace 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "1.9.3" 187 | stream_channel: 188 | dependency: transitive 189 | description: 190 | name: stream_channel 191 | url: "https://pub.flutter-io.cn" 192 | source: hosted 193 | version: "2.0.0" 194 | string_scanner: 195 | dependency: transitive 196 | description: 197 | name: string_scanner 198 | url: "https://pub.flutter-io.cn" 199 | source: hosted 200 | version: "1.0.5" 201 | term_glyph: 202 | dependency: transitive 203 | description: 204 | name: term_glyph 205 | url: "https://pub.flutter-io.cn" 206 | source: hosted 207 | version: "1.1.0" 208 | test_api: 209 | dependency: transitive 210 | description: 211 | name: test_api 212 | url: "https://pub.flutter-io.cn" 213 | source: hosted 214 | version: "0.2.11" 215 | typed_data: 216 | dependency: transitive 217 | description: 218 | name: typed_data 219 | url: "https://pub.flutter-io.cn" 220 | source: hosted 221 | version: "1.1.6" 222 | vector_math: 223 | dependency: transitive 224 | description: 225 | name: vector_math 226 | url: "https://pub.flutter-io.cn" 227 | source: hosted 228 | version: "2.0.8" 229 | xml: 230 | dependency: transitive 231 | description: 232 | name: xml 233 | url: "https://pub.flutter-io.cn" 234 | source: hosted 235 | version: "3.5.0" 236 | sdks: 237 | dart: ">=2.4.0 <3.0.0" 238 | flutter: ">=1.10.0 <2.0.0" 239 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: faliplayer_example 2 | description: Demonstrates how to use the faliplayer plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: ">=2.1.0 <3.0.0" 7 | 8 | dependencies: 9 | flutter: 10 | sdk: flutter 11 | path: ^1.6.4 12 | path_provider: ^1.6.1 13 | # The following adds the Cupertino Icons font to your application. 14 | # Use with the CupertinoIcons class for iOS style icons. 15 | cupertino_icons: ^0.1.2 16 | 17 | dev_dependencies: 18 | flutter_test: 19 | sdk: flutter 20 | 21 | faliplayer: 22 | path: ../ 23 | 24 | # For information on the generic Dart part of this file, see the 25 | # following page: https://dart.dev/tools/pub/pubspec 26 | 27 | # The following section is specific to Flutter. 28 | flutter: 29 | 30 | # The following line ensures that the Material Icons font is 31 | # included with your application, so that you can use the icons in 32 | # the material Icons class. 33 | uses-material-design: true 34 | 35 | # To add assets to your application, add an assets section, like this: 36 | # assets: 37 | # - images/a_dot_burr.jpeg 38 | # - images/a_dot_ham.jpeg 39 | 40 | # An image asset can refer to one or more resolution-specific "variants", see 41 | # https://flutter.dev/assets-and-images/#resolution-aware. 42 | 43 | # For details regarding adding assets from package dependencies, see 44 | # https://flutter.dev/assets-and-images/#from-packages 45 | 46 | # To add custom fonts to your application, add a fonts section here, 47 | # in this "flutter" section. Each entry in this list should have a 48 | # "family" key with the font family name, and a "fonts" key with a 49 | # list giving the asset and other descriptors for the font. For 50 | # example: 51 | # fonts: 52 | # - family: Schyler 53 | # fonts: 54 | # - asset: fonts/Schyler-Regular.ttf 55 | # - asset: fonts/Schyler-Italic.ttf 56 | # style: italic 57 | # - family: Trajan Pro 58 | # fonts: 59 | # - asset: fonts/TrajanPro.ttf 60 | # - asset: fonts/TrajanPro_Bold.ttf 61 | # weight: 700 62 | # 63 | # For details regarding fonts from package dependencies, 64 | # see https://flutter.dev/custom-fonts/#from-packages 65 | -------------------------------------------------------------------------------- /example/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:faliplayer_example/main.dart'; 12 | 13 | void main() { 14 | testWidgets('Verify Platform version', (WidgetTester tester) async { 15 | // Build our app and trigger a frame. 16 | await tester.pumpWidget(MyApp()); 17 | 18 | // Verify that platform version is retrieved. 19 | expect( 20 | find.byWidgetPredicate( 21 | (Widget widget) => widget is Text && 22 | widget.data.startsWith('Running on:'), 23 | ), 24 | findsOneWidget, 25 | ); 26 | }); 27 | } 28 | -------------------------------------------------------------------------------- /faliplayer.iml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /gif/s.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/gif/s.gif -------------------------------------------------------------------------------- /ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/flutter_export_environment.sh -------------------------------------------------------------------------------- /ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HongZhiQing/FAliPlayer/00482d82e945301445150317a6b712d40eb539f1/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /ios/Classes/FAliPlayListFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Neal on 2020/3/18. 3 | // 4 | 5 | #import 6 | #import "Flutter/Flutter.h" 7 | 8 | @interface FAliPlayListFactory : NSObject 9 | - (instancetype)initWithMessenger:(NSObject*)messenger; 10 | -(NSObject *)createArgsCodec; 11 | 12 | -(NSObject *)createWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id)args; 13 | @end -------------------------------------------------------------------------------- /ios/Classes/FAliPlayListFactory.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Neal on 2020/3/18. 3 | // 4 | 5 | #import "FAliPlayListFactory.h" 6 | #import "FAliPlayerView.h" 7 | 8 | @interface FAliPlayListFactory () 9 | @property(nonatomic) NSObject *messenger; 10 | 11 | @end 12 | 13 | @implementation FAliPlayListFactory { 14 | FAliPlayerView *fAliPlayerView; 15 | } 16 | - (instancetype)initWithMessenger:(NSObject *)messenger { 17 | self = [super init]; 18 | if (self) { 19 | NSLog(@"Factory 注册"); 20 | self.messenger = messenger; 21 | 22 | } 23 | return self; 24 | } 25 | 26 | - (NSObject *)createArgsCodec { 27 | return [FlutterStandardMessageCodec sharedInstance]; 28 | } 29 | 30 | - (NSObject *)createWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id)args { 31 | if(!fAliPlayerView){ 32 | fAliPlayerView = [[FAliPlayerView alloc] initWithWithFrame:frame viewIdentifier:viewId arguments:args player:nil binaryMessenger:_messenger]; 33 | } 34 | return fAliPlayerView; 35 | } 36 | 37 | @end -------------------------------------------------------------------------------- /ios/Classes/FAliPlayerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Neal on 2020/3/18. 3 | // 4 | 5 | #import 6 | #import "Flutter/Flutter.h" 7 | #import "AliyunPlayer/AVPDelegate.h" 8 | 9 | @interface FAliPlayerView : NSObject 10 | - (instancetype _Nullable)initWithWithFrame:(CGRect)frame 11 | viewIdentifier:(int64_t)viewId 12 | arguments:(id _Nullable)args 13 | player:(id _Nullable)player 14 | binaryMessenger:(NSObject *_Nullable)messenger; 15 | @end -------------------------------------------------------------------------------- /ios/Classes/FAliPlayerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Neal on 2020/3/18. 3 | // 4 | 5 | #import "FAliPlayerView.h" 6 | #import "FAliPlayerView.h" 7 | #import "AliyunPlayer/AliListPlayer.h" 8 | 9 | 10 | @implementation FAliPlayerView { 11 | UIView *playerView; 12 | FlutterMethodChannel *channel; 13 | FlutterEventSink eventSink; 14 | AliListPlayer *aliListPlayer; 15 | } 16 | - (FAliPlayerView *)initWithWithFrame:(CGRect)frame viewIdentifier:(int64_t)viewId arguments:(id _Nullable)args player:(id _Nullable)player binaryMessenger:(NSObject *_Nullable)messenger { 17 | if ([super init]) { 18 | ///初始化渠道 19 | [self initChannel:viewId messenger:messenger]; 20 | ///初始化view 21 | aliListPlayer = [[AliListPlayer alloc] init]; 22 | aliListPlayer.delegate = self; 23 | aliListPlayer.scalingMode = AVP_SCALINGMODE_SCALEASPECTFILL;///画面铺面.dart层控制宽高 24 | 25 | ///循环播放 26 | aliListPlayer.loop = @([args[@"loop"] intValue]).boolValue; 27 | 28 | AVPCacheConfig *cacheConfig = [[AVPCacheConfig alloc] init]; 29 | //开启缓存功能 30 | cacheConfig.enable = YES; 31 | //能够缓存的单个文件最大时长。超过此长度则不缓存 32 | cacheConfig.maxDuration = 100; 33 | //缓存目录的位置,需替换成app期望的路径 34 | cacheConfig.path = [self getCachesPath]; 35 | //缓存目录的最大大小。超过此大小,将会删除最旧的缓存文件 36 | cacheConfig.maxSizeMB = 1024; 37 | //设置缓存配置给到播放器 38 | NSLog(@"设置:%d", [aliListPlayer setCacheConfig:cacheConfig]); 39 | 40 | 41 | playerView = [UIView new]; 42 | aliListPlayer.playerView = playerView; 43 | aliListPlayer.playerView.frame = frame; 44 | aliListPlayer.autoPlay = YES; 45 | } 46 | 47 | return self; 48 | } 49 | 50 | - (void)initChannel:(int64_t)viewId messenger:(NSObject *)messenger { 51 | NSString *methodChannelName = [NSString stringWithFormat:@"plugin.iqingbai.com/ali_video_play_%lld", viewId]; 52 | NSString *eventChannelName = [NSString stringWithFormat:@"plugin.iqingbai.com/eventChannel/ali_video_play_%lld", viewId]; 53 | [[FlutterEventChannel 54 | eventChannelWithName:eventChannelName 55 | binaryMessenger:messenger] setStreamHandler:self]; 56 | channel = [FlutterMethodChannel methodChannelWithName:methodChannelName binaryMessenger:messenger]; 57 | __weak __typeof__(self) weakSelf = self; 58 | [channel setMethodCallHandler:^(FlutterMethodCall *call, FlutterResult result) { 59 | [weakSelf onMethodCall:call result:result]; 60 | }]; 61 | } 62 | 63 | - (UIView *)view { 64 | return aliListPlayer.playerView; 65 | } 66 | 67 | - (void)onMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { 68 | NSLog(@"call method:%@", call.method); 69 | if ([call.method isEqualToString:@"moveTo"]) { 70 | NSString *url = call.arguments[@"url"]; 71 | result(@([aliListPlayer moveTo:url])); 72 | } else if ([call.method isEqualToString:@"moveToPre"]) { 73 | result(@([aliListPlayer moveToPre])); 74 | } else if ([call.method isEqualToString:@"moveToNext"]) { 75 | result(@([aliListPlayer moveToNext])); 76 | } else if ([call.method isEqualToString:@"start"]) { 77 | [aliListPlayer start]; 78 | } else if ([call.method isEqualToString:@"pause"]) { 79 | [aliListPlayer pause]; 80 | } else if ([call.method isEqualToString:@"seekTo"]) { 81 | int64_t time = (int64_t) call.arguments[@"time"]; 82 | [aliListPlayer seekToTime:time seekMode:AVP_SEEKMODE_INACCURATE]; 83 | } else if ([call.method isEqualToString:@"getCachesPath"]) { 84 | NSString *url = call.arguments[@"url"]; 85 | result([aliListPlayer getCacheFilePath:url]); 86 | } else if ([call.method isEqualToString:@"setScalingMode"]) { 87 | int mode = [call.arguments[@"mode"] intValue]; 88 | aliListPlayer.scalingMode = (AVPScalingMode) mode;///画面铺面.dart层控制宽高 89 | } else if ([call.method isEqualToString:@"addUrlSource"]) { 90 | NSArray *list = call.arguments[@"urls"]; 91 | for (int i = 0; i < list.count; ++i) { 92 | [aliListPlayer addUrlSource:list[(NSUInteger) i] uid:list[(NSUInteger) i]]; 93 | } 94 | } 95 | 96 | } 97 | 98 | //获取缓存文件路径 99 | - (NSString *)getCachesPath { 100 | // 获取Caches目录路径 101 | NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES); 102 | NSString *cachesDir = paths[0]; 103 | 104 | //指定文件名 105 | NSString *filePath = [cachesDir stringByAppendingPathComponent:@"com.st.video"]; 106 | long size = [self fileSizeAtPath:filePath]; 107 | NSLog(@"缓存目录:%@", cachesDir); 108 | NSLog(@"缓存目录2:%@", filePath); 109 | NSLog(@"缓存目录大小:%ld", size); 110 | return filePath; 111 | } 112 | 113 | - (long long)fileSizeAtPath:(NSString *)filePath { 114 | NSFileManager *manager = [NSFileManager defaultManager]; 115 | if ([manager fileExistsAtPath:filePath]) { 116 | 117 | // //取得一个目录下得所有文件名 118 | NSArray *files = [manager subpathsAtPath:filePath]; 119 | NSLog(@"files1111111%@ == %ld", files, files.count); 120 | // 121 | // // 从路径中获得完整的文件名(带后缀) 122 | // NSString *exe = [filePath lastPathComponent]; 123 | // NSLog(@"exeexe ====%@",exe); 124 | // 125 | // // 获得文件名(不带后缀) 126 | // exe = [exe stringByDeletingPathExtension]; 127 | // 128 | // // 获得文件名(不带后缀) 129 | // NSString *exestr = [[files objectAtIndex:1] stringByDeletingPathExtension]; 130 | // NSLog(@"files2222222%@ ==== %@",[files objectAtIndex:1],exestr); 131 | 132 | 133 | return [[manager attributesOfItemAtPath:filePath error:nil] fileSize]; 134 | } 135 | 136 | return 0; 137 | } 138 | 139 | - (FlutterError *_Nullable)onListenWithArguments:(id _Nullable)arguments eventSink:(FlutterEventSink)events { 140 | eventSink = events; 141 | return nil; 142 | } 143 | 144 | - (FlutterError *_Nullable)onCancelWithArguments:(id _Nullable)arguments { 145 | eventSink = nil; 146 | return nil; 147 | } 148 | 149 | - (void)onPlayerStatusChanged:(AliPlayer *)player oldStatus:(AVPStatus)oldStatus newStatus:(AVPStatus)newStatus { 150 | NSLog(@"onPlayerStatusChanged:%@", @(newStatus)); 151 | if (eventSink) { 152 | eventSink(@{ 153 | @"eventType": @"onPlayerStatusChanged", 154 | @"values": @(newStatus) 155 | }); 156 | } 157 | } 158 | - (void)onTrackReady:(AliPlayer *)player info:(NSArray *)info { 159 | // NSLog(@"onTrackReady :%d === %d", info[0].videoWidth,info[0].videoHeight); 160 | // if(info[0].videoWidth 2 | 3 | @interface FaliplayerPlugin : NSObject 4 | @end 5 | -------------------------------------------------------------------------------- /ios/Classes/FaliplayerPlugin.m: -------------------------------------------------------------------------------- 1 | #import "FaliplayerPlugin.h" 2 | #import "FAliPlayListFactory.h" 3 | 4 | @implementation FaliplayerPlugin 5 | + (void)registerWithRegistrar:(NSObject *)registrar { 6 | FlutterMethodChannel *channel = [FlutterMethodChannel 7 | methodChannelWithName:@"faliplayer" 8 | binaryMessenger:[registrar messenger]]; 9 | FaliplayerPlugin *instance = [[FaliplayerPlugin alloc] init]; 10 | [registrar addMethodCallDelegate:instance channel:channel]; 11 | FAliPlayListFactory *aliPlayerFactory = [[FAliPlayListFactory alloc] initWithMessenger:registrar.messenger]; 12 | [registrar registerViewFactory:aliPlayerFactory withId:@"plugin.iqingbai.com/ali_video_play"]; 13 | } 14 | 15 | - (void)handleMethodCall:(FlutterMethodCall *)call result:(FlutterResult)result { 16 | if ([@"getPlatformVersion" isEqualToString:call.method]) { 17 | result([@"iOS " stringByAppendingString:[[UIDevice currentDevice] systemVersion]]); 18 | } else { 19 | result(FlutterMethodNotImplemented); 20 | } 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /ios/faliplayer.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint faliplayer.podspec' to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'faliplayer' 7 | s.version = '0.0.1' 8 | s.summary = 'A new Flutter plugin.' 9 | s.description = <<-DESC 10 | A new Flutter plugin. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.public_header_files = 'Classes/**/*.h' 18 | s.dependency 'Flutter' 19 | s.dependency 'AliPlayerSDK_iOS' 20 | s.platform = :ios, '8.0' 21 | 22 | # Flutter.framework does not contain a i386 slice. Only x86_64 simulators are supported. 23 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS[sdk=iphonesimulator*]' => 'x86_64' } 24 | end 25 | -------------------------------------------------------------------------------- /lib/faliplayer.dart: -------------------------------------------------------------------------------- 1 | export 'src/list/alilistplayer.dart'; 2 | export 'src/list/alilistcontroller.dart'; 3 | export 'src/aliplayer.dart'; 4 | export 'src/controller.dart'; 5 | -------------------------------------------------------------------------------- /lib/src/aliplayer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:faliplayer/faliplayer.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/services.dart'; 6 | 7 | class FAliPlayerView extends StatefulWidget { 8 | final FAliPlayerController controller; 9 | final String url; 10 | final bool isCurrentLocation; 11 | 12 | const FAliPlayerView( 13 | {Key key, this.controller, this.isCurrentLocation, this.url}) 14 | : super(key: key); 15 | 16 | @override 17 | _FAliPlayerViewState createState() => _FAliPlayerViewState(); 18 | } 19 | 20 | class _FAliPlayerViewState extends State { 21 | @override 22 | void initState() { 23 | // TODO: implement initState 24 | super.initState(); 25 | widget.controller.setFirstRenderedStartListener(() { 26 | print('firstRenderedStart:${widget.controller.firstRenderedStart}'); 27 | if (widget.controller.firstRenderedStart) { 28 | setState(() {}); 29 | widget.controller.firstRenderedStart = false; 30 | } 31 | }); 32 | } 33 | 34 | @override 35 | Widget build(BuildContext context) { 36 | return LayoutBuilder( 37 | builder: (context, contraints) { 38 | Widget body = Container( 39 | color: Colors.black, 40 | ); 41 | body = Platform.isAndroid 42 | ? AndroidView( 43 | viewType: "plugin.iqingbai.com/ali_video_play_single_", 44 | creationParamsCodec: const StandardMessageCodec(), 45 | onPlatformViewCreated: widget.controller.onViewCreate, 46 | creationParams: { 47 | "cacheConfig": widget.controller.cacheConfig?.toJson(), 48 | "url": widget.url ?? " ", 49 | "loop": widget.controller.loop, 50 | "auto": widget.controller.isAutoPlay 51 | }, 52 | ) 53 | : UiKitView( 54 | viewType: "plugin.iqingbai.com/ali_video_play_single_", 55 | creationParamsCodec: const StandardMessageCodec(), 56 | onPlatformViewCreated: widget.controller.onViewCreate, 57 | ); 58 | return Container( 59 | color: Colors.black, 60 | child: Stack( 61 | alignment: Alignment.center, 62 | children: [ 63 | Container( 64 | color: Colors.black, 65 | child: Image.network( 66 | "${widget.url}?vframe/jpg/offset/1"), 67 | ), 68 | Offstage(offstage: !widget.isCurrentLocation, child: body), 69 | ], 70 | ), 71 | ); 72 | }, 73 | ); 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /lib/src/controller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:faliplayer/faliplayer.dart'; 4 | import 'package:flutter/services.dart'; 5 | 6 | 7 | class FAliPlayerController { 8 | MethodChannel _channel; 9 | StreamSubscription _streamSubscription; 10 | 11 | ///自动播放 12 | bool isAutoPlay; 13 | 14 | ///循环播放 15 | bool loop; 16 | 17 | ///缓存配置 18 | AVPCacheConfig cacheConfig; 19 | 20 | ///标记第一帧渲染成功,每次都切换新的视频都会标记为true 21 | ///用到的地方需要手动标记为false,否则会一直为true 22 | bool firstRenderedStart = false; 23 | 24 | ///第一帧渲染成功的监听器,每次切换新的视频都会调用 25 | FirstRenderedStartListener _firstRenderedStartListener; 26 | 27 | OnBufferedPositionUpdateListener _bufferedPositionUpdateListener; 28 | 29 | OnPositionUpdateListener _positionUpdateListener; 30 | 31 | void setBufferedPositionUpdateListener( 32 | OnBufferedPositionUpdateListener value) { 33 | _bufferedPositionUpdateListener = value; 34 | } 35 | 36 | void setPositionUpdateListener(OnPositionUpdateListener value) { 37 | _positionUpdateListener = value; 38 | } 39 | 40 | FAliPlayerController( 41 | {this.isAutoPlay = false, this.cacheConfig, this.loop = false}); 42 | 43 | 44 | onViewCreate(int i) { 45 | _channel = MethodChannel("plugin.iqingbai.com/ali_video_play_single_$i"); 46 | _streamSubscription = EventChannel( 47 | "plugin.iqingbai.com/eventChannel/ali_video_play_single_$i") 48 | .receiveBroadcastStream() 49 | .listen(_onEvent); 50 | if (isAutoPlay) { 51 | this.start(); 52 | } 53 | } 54 | 55 | setFirstRenderedStartListener(FirstRenderedStartListener listener) { 56 | this._firstRenderedStartListener = listener; 57 | } 58 | 59 | /// 设置缓存配置,请在初始化时设置 60 | void setCacheConfig(AVPCacheConfig config) { 61 | this.cacheConfig = config; 62 | print('cacheConfig:${cacheConfig.path}'); 63 | } 64 | 65 | ///开始播放 66 | Future start() { 67 | return _channel?.invokeMethod("start"); 68 | } 69 | 70 | ///暂停 71 | Future pause() { 72 | return _channel?.invokeMethod("pause"); 73 | } 74 | 75 | ///获取缓存文件的路径 76 | ///[url]文件的url 77 | Future getCachePath(String url) { 78 | return _channel?.invokeMethod("getCachesPath"); 79 | } 80 | 81 | ///设置是否静音 82 | Future setMute(bool mute) { 83 | return _channel?.invokeMethod("setMute", {"mute": mute}); 84 | } 85 | 86 | ///设置跳转进度 87 | Future seekTo(int position) { 88 | return _channel?.invokeMethod("seekTo", {"seekTo": position}); 89 | } 90 | 91 | 92 | void _onEvent(event) { 93 | String type = event['eventType']; 94 | switch (type) { 95 | case "onPlayerEvent": 96 | print('event:${event["values"]}'); 97 | if (event["values"] == AVPEventType.AVPEventFirstRenderedStart.index) { 98 | // firstRenderedStart = true; 99 | } 100 | break; 101 | case "onPlayerStatusChanged": 102 | print('onPlayerStatusChanged:${event["values"]}'); 103 | if (event["values"] == 3) { 104 | firstRenderedStart = true; 105 | this._firstRenderedStartListener(); 106 | } 107 | break; 108 | case "onCurrentPositionUpdate": 109 | if (this._positionUpdateListener != null) { 110 | this._positionUpdateListener(event["values"]); 111 | } 112 | break; 113 | case "onBufferedPositionUpdate": 114 | if (this._bufferedPositionUpdateListener != null) { 115 | this._bufferedPositionUpdateListener(event["values"]); 116 | } 117 | break; 118 | } 119 | } 120 | 121 | void dispose() { 122 | _streamSubscription.cancel(); 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /lib/src/list/alilistcontroller.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/services.dart'; 4 | 5 | typedef FirstRenderedStartListener = void Function(); 6 | 7 | ///当前播放进度更新 8 | typedef OnPositionUpdateListener = void Function(int position); 9 | 10 | ///当前缓存进度更新 11 | typedef OnBufferedPositionUpdateListener = void Function(int position); 12 | 13 | ///当前缓存进度更新 14 | typedef OnPlayEventListener = void Function(AVPEventType eventType); 15 | 16 | ///大小改变回调 17 | typedef OnVideoSizeChanged = void Function(); 18 | 19 | ///监听播放器状态 20 | typedef OnStateChange = void Function(int state); 21 | 22 | enum AVPEventType { 23 | ///准备完成事件*/ 24 | AVPEventPrepareDone, 25 | 26 | ///自动启播事件*/ 27 | AVPEventAutoPlayStart, 28 | 29 | ///首帧显示事件*/ 30 | AVPEventFirstRenderedStart, 31 | 32 | ///播放完成事件*/ 33 | AVPEventCompletion, 34 | 35 | ///缓冲开始事件*/ 36 | AVPEventLoadingStart, 37 | 38 | ///缓冲完成事件*/ 39 | AVPEventLoadingEnd, 40 | 41 | ///跳转完成事件*/ 42 | AVPEventSeekEnd, 43 | 44 | ///循环播放开始事件*/ 45 | AVPEventLoopingStart, 46 | } 47 | enum AVPStatus { 48 | ///空转,闲时,静态 49 | AVPStatusIdle, 50 | 51 | /// 初始化完成 52 | AVPStatusInitialzed, 53 | 54 | /// 准备完成 55 | AVPStatusPrepared, 56 | 57 | /// 正在播放 58 | AVPStatusStarted, 59 | 60 | /// 播放暂停 61 | AVPStatusPaused, 62 | 63 | /// 播放停止 64 | AVPStatusStopped, 65 | 66 | /// 播放完成 67 | AVPStatusCompletion, 68 | 69 | /// 播放错误 70 | AVPStatusError 71 | } 72 | enum AVPScalingMode { 73 | SCALETOFILL, 74 | SCALEASPECTFIT, 75 | SCALEASPECTFILL, 76 | } 77 | 78 | class AVPCacheConfig { 79 | ///缓存目录 80 | final String path; 81 | 82 | ///单位秒 83 | final int maxDuration; 84 | 85 | ///单位M 86 | final int maxSizeMB; 87 | 88 | AVPCacheConfig({this.path, this.maxDuration, this.maxSizeMB}); 89 | 90 | Map toJson() => 91 | {"path": path, "maxDuration": maxDuration, "maxSizeMB": maxSizeMB}; 92 | } 93 | 94 | class FAliListPlayerController { 95 | MethodChannel _channel; 96 | StreamSubscription _streamSubscription; 97 | 98 | ///播放列表的URL组 99 | List urls; 100 | 101 | ///自动播放 102 | bool isAutoPlay; 103 | 104 | ///循环播放 105 | bool loop; 106 | 107 | ///标记第一帧渲染成功,每次都切换新的视频都会标记为true 108 | ///用到的地方需要手动标记为false,否则会一直为true 109 | bool firstRenderedStart = false; 110 | 111 | ///缓存配置 112 | AVPCacheConfig cacheConfig; 113 | 114 | ///当前视频的高 115 | int height; 116 | 117 | ///当前视频的宽 118 | int width; 119 | 120 | int currentStatus; 121 | 122 | ///第一帧渲染成功的监听器,每次切换新的视频都会调用 123 | FirstRenderedStartListener _firstRenderedStartListener; 124 | 125 | OnBufferedPositionUpdateListener _bufferedPositionUpdateListener; 126 | 127 | OnPositionUpdateListener _positionUpdateListener; 128 | 129 | OnVideoSizeChanged _onVideoSizeChanged; 130 | 131 | OnPlayEventListener _onPlayEventListener; 132 | 133 | OnStateChange _onStateChange; 134 | 135 | FAliListPlayerController( 136 | {this.isAutoPlay = true, this.cacheConfig, this.loop = false}) { 137 | urls = List(); 138 | } 139 | 140 | /// 当前是否正在播放 141 | bool get isPlaying => currentStatus == AVPStatus.AVPStatusStarted.index; 142 | 143 | void setBufferedPositionUpdateListener( 144 | OnBufferedPositionUpdateListener value) { 145 | _bufferedPositionUpdateListener = value; 146 | } 147 | 148 | /// 设置当前播放位置监听 149 | void setPositionUpdateListener(OnPositionUpdateListener value) { 150 | _positionUpdateListener = value; 151 | } 152 | 153 | /// 设置首帧渲染完成的监听器 154 | setFirstRenderedStartListener(FirstRenderedStartListener listener) { 155 | this._firstRenderedStartListener = listener; 156 | } 157 | 158 | /// 设置视频宽高变化监听 159 | setOnVideoSizeChanged(OnVideoSizeChanged listener) { 160 | this._onVideoSizeChanged = listener; 161 | } 162 | 163 | ///播放器事件监听 164 | setOnPlayEventListener(OnPlayEventListener listener) { 165 | this._onPlayEventListener = listener; 166 | } 167 | 168 | ///播放器状态监听 169 | setOnStateChange(OnStateChange listener) { 170 | this._onStateChange = listener; 171 | } 172 | 173 | /// 设置缓存配置,请在初始化时设置 174 | void setCacheConfig(AVPCacheConfig config) { 175 | this.cacheConfig = config; 176 | } 177 | 178 | /// 往视频播放列表添加预加载urls 179 | void addUrls(List urls) { 180 | this.urls.addAll(urls); 181 | } 182 | 183 | ///开始播放 184 | Future start() { 185 | return _channel?.invokeMethod("start"); 186 | } 187 | 188 | ///暂停 189 | Future pause() { 190 | return _channel?.invokeMethod("pause"); 191 | } 192 | 193 | ///移到下一个 194 | Future moveToNext() { 195 | return _channel?.invokeMethod("moveToNext"); 196 | } 197 | 198 | ///移到上一个 199 | Future moveToPre() { 200 | return _channel?.invokeMethod("moveToPre"); 201 | } 202 | 203 | Future setScalingMode(AVPScalingMode mode) { 204 | return _channel?.invokeMethod("setScalingMode", { 205 | "mode": mode.index, 206 | }); 207 | } 208 | 209 | ///移动到目标视频,并播放 210 | ///[index]是视频的标识坐标 211 | Future moveTo(int index) { 212 | return _channel?.invokeMethod("moveTo", { 213 | "url": urls[index], 214 | }); 215 | } 216 | 217 | ///获取缓存文件的路径 218 | ///[url]文件的url 219 | Future getCachePath(String url) { 220 | return _channel?.invokeMethod("getCachesPath", {"url": url}); 221 | } 222 | 223 | Future seekTo(int position) { 224 | return _channel?.invokeMethod("seekTo", {"position": position}); 225 | } 226 | 227 | void _onEvent(event) { 228 | String type = event['eventType']; 229 | switch (type) { 230 | case "onPlayerEvent": 231 | if (_onPlayEventListener != null) { 232 | _onPlayEventListener(event["values"]); 233 | } 234 | break; 235 | case "onPlayerStatusChanged": 236 | currentStatus = event["values"]; 237 | if (event["values"] == AVPStatus.AVPStatusStarted.index) { 238 | firstRenderedStart = true; 239 | if (width < height) { 240 | this.setScalingMode(AVPScalingMode.SCALEASPECTFILL); 241 | } else { 242 | this.setScalingMode(AVPScalingMode.SCALEASPECTFIT); 243 | } 244 | this._firstRenderedStartListener(); 245 | } 246 | if (_onStateChange != null) { 247 | this._onStateChange(event["values"]); 248 | } 249 | break; 250 | case "onCurrentPositionUpdate": 251 | if (this._positionUpdateListener != null) { 252 | this._positionUpdateListener(event["values"]); 253 | } 254 | break; 255 | case "onBufferedPositionUpdate": 256 | if (this._bufferedPositionUpdateListener != null) { 257 | this._bufferedPositionUpdateListener(event["values"]); 258 | } 259 | break; 260 | case "onVideoSizeChanged": 261 | this.height = event["height"]; 262 | this.width = event["width"]; 263 | if (this._onVideoSizeChanged != null) { 264 | this._onVideoSizeChanged(); 265 | } 266 | break; 267 | } 268 | } 269 | 270 | void dispose() { 271 | _streamSubscription?.cancel(); 272 | } 273 | 274 | void onViewCreate(int i) { 275 | if (_channel == null && _streamSubscription == null) { 276 | _channel = MethodChannel("plugin.iqingbai.com/ali_video_play_$i"); 277 | 278 | _streamSubscription = 279 | EventChannel("plugin.iqingbai.com/eventChannel/ali_video_play_$i") 280 | .receiveBroadcastStream() 281 | .listen(_onEvent); 282 | 283 | _channel.invokeMethod("addUrlSource", {"urls": urls}); 284 | if (isAutoPlay || urls.length > 0) { 285 | this.moveTo(0); 286 | } 287 | } 288 | } 289 | } 290 | -------------------------------------------------------------------------------- /lib/src/list/alilistplayer.dart: -------------------------------------------------------------------------------- 1 | import 'dart:io'; 2 | 3 | import 'package:faliplayer/faliplayer.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter/services.dart'; 6 | 7 | typedef PageBuilder = Widget Function(BuildContext context, int index); 8 | typedef ThumbImageBuilder = Widget Function( 9 | BuildContext context, int index, int heigth, int width); 10 | typedef VideoSizeBuild = Size Function(BuildContext context, int index); 11 | 12 | var _defaultBuild = (c, i) => Container(); 13 | 14 | class FAliListPlayerView extends StatefulWidget { 15 | final FAliListPlayerController controller; 16 | 17 | /// 构造视频上层UI 18 | final PageBuilder pageBuilder; 19 | 20 | /// 构造视频缩略图 21 | final ThumbImageBuilder thumbImageBuilder; 22 | 23 | /// 背景颜色 24 | final Color backgroundColor; 25 | 26 | /// Video宽高的回调 27 | final VideoSizeBuild videoSizeBuild; 28 | 29 | ///使用默认UI 30 | FAliListPlayerView({ 31 | Key key, 32 | this.controller, 33 | this.backgroundColor = Colors.black, 34 | }) : pageBuilder = _defaultBuild, 35 | thumbImageBuilder = null, 36 | videoSizeBuild = null, 37 | super(key: key); 38 | 39 | ///自定义pageUI 40 | FAliListPlayerView.builder({ 41 | this.controller, 42 | this.pageBuilder, 43 | this.thumbImageBuilder, 44 | this.backgroundColor = Colors.black, 45 | this.videoSizeBuild, 46 | }); 47 | 48 | @override 49 | _FAliListPlayerViewState createState() => _FAliListPlayerViewState(); 50 | } 51 | 52 | class _FAliListPlayerViewState extends State { 53 | PageController _pageController = PageController(); 54 | int currentIndex = 0; 55 | 56 | @override 57 | void initState() { 58 | /// 设置第一帧渲染成功回调 59 | /// 这样做的目的是为了不让切换视频的时候造成闪屏 60 | /// 在切换界面的时间pageController先收到回调 61 | /// 然后把视频列表切换到目标index的视频 62 | /// [currentIndex]设置成当前播放的index,但是不[setState] 63 | /// 在切换完成并且第一帧已经渲染完成之后才setState 64 | widget.controller.setFirstRenderedStartListener(() { 65 | if (widget.controller.firstRenderedStart) { 66 | setState(() {}); 67 | widget.controller.firstRenderedStart = false; 68 | } 69 | }); 70 | _pageController.addListener(() { 71 | if (isIntegerForDouble(_pageController.page)) { 72 | double page = _pageController.page; 73 | if (page != currentIndex) { 74 | widget.controller.moveTo(page.toInt()); 75 | currentIndex = page.toInt(); 76 | } 77 | } 78 | }); 79 | super.initState(); 80 | } 81 | 82 | @override 83 | Widget build(BuildContext context) { 84 | return PageView.builder( 85 | controller: _pageController, 86 | scrollDirection: Axis.vertical, 87 | itemBuilder: (c, i) { 88 | Widget body = Container( 89 | color: Colors.black, 90 | ); 91 | if (currentIndex == i) { 92 | body = VideoView( 93 | controller: widget.controller, 94 | ); 95 | } 96 | var pageUi = 97 | widget.pageBuilder == null ? Container() : widget.pageBuilder(c, i); 98 | 99 | Widget thumbImage = widget.thumbImageBuilder != null 100 | ? widget.thumbImageBuilder( 101 | c, i, widget.controller.height, widget.controller.width) 102 | : Container(); 103 | 104 | return Container( 105 | color: widget.backgroundColor, 106 | child: Stack( 107 | alignment: Alignment.center, 108 | children: [ 109 | thumbImage, 110 | Offstage( 111 | offstage: !(currentIndex == i), 112 | child: Container(child: body)), 113 | pageUi, 114 | ], 115 | ), 116 | ); 117 | }, 118 | itemCount: widget.controller.urls.length, 119 | ); 120 | } 121 | 122 | /// 判断double为整数 123 | bool isIntegerForDouble(double obj) { 124 | if (obj == 0) { 125 | return true; 126 | } 127 | double eps = 1e-10; // 精度范围 128 | print('obj - (obj ~/ obj):${obj - (obj ~/ obj)}'); 129 | return obj - obj.floor() < eps; 130 | } 131 | } 132 | 133 | class VideoView extends StatefulWidget { 134 | final FAliListPlayerController controller; 135 | 136 | const VideoView({Key key, this.controller}) : super(key: key); 137 | 138 | @override 139 | _VideoViewState createState() => _VideoViewState(); 140 | } 141 | 142 | class _VideoViewState extends State { 143 | @override 144 | Widget build(BuildContext context) { 145 | if (Platform.isAndroid) { 146 | return AndroidView( 147 | viewType: "plugin.iqingbai.com/ali_video_play", 148 | creationParamsCodec: const StandardMessageCodec(), 149 | onPlatformViewCreated: widget.controller.onViewCreate, 150 | creationParams: { 151 | "cacheConfig": widget.controller.cacheConfig?.toJson(), 152 | "loop": widget.controller.loop, 153 | "auto": widget.controller.isAutoPlay, 154 | }, 155 | ); 156 | } 157 | 158 | return UiKitView( 159 | viewType: "plugin.iqingbai.com/ali_video_play", 160 | creationParams: { 161 | "cacheConfig": widget.controller.cacheConfig?.toJson(), 162 | "loop": widget.controller.loop 163 | }, 164 | creationParamsCodec: const StandardMessageCodec(), 165 | onPlatformViewCreated: widget.controller.onViewCreate, 166 | ); 167 | } 168 | 169 | @override 170 | void dispose() { 171 | // TODO: implement dispose 172 | super.dispose(); 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | archive: 5 | dependency: transitive 6 | description: 7 | name: archive 8 | url: "https://pub.flutter-io.cn" 9 | source: hosted 10 | version: "2.0.11" 11 | args: 12 | dependency: transitive 13 | description: 14 | name: args 15 | url: "https://pub.flutter-io.cn" 16 | source: hosted 17 | version: "1.5.2" 18 | async: 19 | dependency: transitive 20 | description: 21 | name: async 22 | url: "https://pub.flutter-io.cn" 23 | source: hosted 24 | version: "2.4.0" 25 | boolean_selector: 26 | dependency: transitive 27 | description: 28 | name: boolean_selector 29 | url: "https://pub.flutter-io.cn" 30 | source: hosted 31 | version: "1.0.5" 32 | charcode: 33 | dependency: transitive 34 | description: 35 | name: charcode 36 | url: "https://pub.flutter-io.cn" 37 | source: hosted 38 | version: "1.1.2" 39 | collection: 40 | dependency: transitive 41 | description: 42 | name: collection 43 | url: "https://pub.flutter-io.cn" 44 | source: hosted 45 | version: "1.14.11" 46 | convert: 47 | dependency: transitive 48 | description: 49 | name: convert 50 | url: "https://pub.flutter-io.cn" 51 | source: hosted 52 | version: "2.1.1" 53 | crypto: 54 | dependency: transitive 55 | description: 56 | name: crypto 57 | url: "https://pub.flutter-io.cn" 58 | source: hosted 59 | version: "2.1.3" 60 | flutter: 61 | dependency: "direct main" 62 | description: flutter 63 | source: sdk 64 | version: "0.0.0" 65 | flutter_test: 66 | dependency: "direct dev" 67 | description: flutter 68 | source: sdk 69 | version: "0.0.0" 70 | image: 71 | dependency: transitive 72 | description: 73 | name: image 74 | url: "https://pub.flutter-io.cn" 75 | source: hosted 76 | version: "2.1.4" 77 | matcher: 78 | dependency: transitive 79 | description: 80 | name: matcher 81 | url: "https://pub.flutter-io.cn" 82 | source: hosted 83 | version: "0.12.6" 84 | meta: 85 | dependency: transitive 86 | description: 87 | name: meta 88 | url: "https://pub.flutter-io.cn" 89 | source: hosted 90 | version: "1.1.8" 91 | path: 92 | dependency: transitive 93 | description: 94 | name: path 95 | url: "https://pub.flutter-io.cn" 96 | source: hosted 97 | version: "1.6.4" 98 | pedantic: 99 | dependency: transitive 100 | description: 101 | name: pedantic 102 | url: "https://pub.flutter-io.cn" 103 | source: hosted 104 | version: "1.8.0+1" 105 | petitparser: 106 | dependency: transitive 107 | description: 108 | name: petitparser 109 | url: "https://pub.flutter-io.cn" 110 | source: hosted 111 | version: "2.4.0" 112 | quiver: 113 | dependency: transitive 114 | description: 115 | name: quiver 116 | url: "https://pub.flutter-io.cn" 117 | source: hosted 118 | version: "2.0.5" 119 | sky_engine: 120 | dependency: transitive 121 | description: flutter 122 | source: sdk 123 | version: "0.0.99" 124 | source_span: 125 | dependency: transitive 126 | description: 127 | name: source_span 128 | url: "https://pub.flutter-io.cn" 129 | source: hosted 130 | version: "1.5.5" 131 | stack_trace: 132 | dependency: transitive 133 | description: 134 | name: stack_trace 135 | url: "https://pub.flutter-io.cn" 136 | source: hosted 137 | version: "1.9.3" 138 | stream_channel: 139 | dependency: transitive 140 | description: 141 | name: stream_channel 142 | url: "https://pub.flutter-io.cn" 143 | source: hosted 144 | version: "2.0.0" 145 | string_scanner: 146 | dependency: transitive 147 | description: 148 | name: string_scanner 149 | url: "https://pub.flutter-io.cn" 150 | source: hosted 151 | version: "1.0.5" 152 | term_glyph: 153 | dependency: transitive 154 | description: 155 | name: term_glyph 156 | url: "https://pub.flutter-io.cn" 157 | source: hosted 158 | version: "1.1.0" 159 | test_api: 160 | dependency: transitive 161 | description: 162 | name: test_api 163 | url: "https://pub.flutter-io.cn" 164 | source: hosted 165 | version: "0.2.11" 166 | typed_data: 167 | dependency: transitive 168 | description: 169 | name: typed_data 170 | url: "https://pub.flutter-io.cn" 171 | source: hosted 172 | version: "1.1.6" 173 | vector_math: 174 | dependency: transitive 175 | description: 176 | name: vector_math 177 | url: "https://pub.flutter-io.cn" 178 | source: hosted 179 | version: "2.0.8" 180 | xml: 181 | dependency: transitive 182 | description: 183 | name: xml 184 | url: "https://pub.flutter-io.cn" 185 | source: hosted 186 | version: "3.5.0" 187 | sdks: 188 | dart: ">=2.4.0 <3.0.0" 189 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: faliplayer 2 | description: flutter version aliplayer 3 | version: 0.0.1 4 | homepage: https://github.com/Dovvvis/FAliPlayer 5 | 6 | environment: 7 | sdk: ">=2.1.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | dev_dependencies: 14 | flutter_test: 15 | sdk: flutter 16 | 17 | # For information on the generic Dart part of this file, see the 18 | # following page: https://dart.dev/tools/pub/pubspec 19 | 20 | # The following section is specific to Flutter. 21 | flutter: 22 | # This section identifies this Flutter project as a plugin project. 23 | # The androidPackage and pluginClass identifiers should not ordinarily 24 | # be modified. They are used by the tooling to maintain consistency when 25 | # adding or updating assets for this project. 26 | plugin: 27 | androidPackage: com.iqingbai.faliplayer 28 | pluginClass: FaliplayerPlugin 29 | 30 | # To add assets to your plugin package, add an assets section, like this: 31 | # assets: 32 | # - images/a_dot_burr.jpeg 33 | # - images/a_dot_ham.jpeg 34 | # 35 | # For details regarding assets in packages, see 36 | # https://flutter.dev/assets-and-images/#from-packages 37 | # 38 | # An image asset can refer to one or more resolution-specific "variants", see 39 | # https://flutter.dev/assets-and-images/#resolution-aware. 40 | 41 | # To add custom fonts to your plugin package, add a fonts section here, 42 | # in this "flutter" section. Each entry in this list should have a 43 | # "family" key with the font family name, and a "fonts" key with a 44 | # list giving the asset and other descriptors for the font. For 45 | # example: 46 | # fonts: 47 | # - family: Schyler 48 | # fonts: 49 | # - asset: fonts/Schyler-Regular.ttf 50 | # - asset: fonts/Schyler-Italic.ttf 51 | # style: italic 52 | # - family: Trajan Pro 53 | # fonts: 54 | # - asset: fonts/TrajanPro.ttf 55 | # - asset: fonts/TrajanPro_Bold.ttf 56 | # weight: 700 57 | # 58 | # For details regarding fonts in packages, see 59 | # https://flutter.dev/custom-fonts/#from-packages 60 | -------------------------------------------------------------------------------- /test/faliplayer_test.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_test/flutter_test.dart'; 3 | import 'package:faliplayer/faliplayer.dart'; 4 | 5 | //void main() { 6 | // const MethodChannel channel = MethodChannel('faliplayer'); 7 | // 8 | // TestWidgetsFlutterBinding.ensureInitialized(); 9 | // 10 | // setUp(() { 11 | // channel.setMockMethodCallHandler((MethodCall methodCall) async { 12 | // return '42'; 13 | // }); 14 | // }); 15 | // 16 | // tearDown(() { 17 | // channel.setMockMethodCallHandler(null); 18 | // }); 19 | // 20 | // test('getPlatformVersion', () async { 21 | // expect(await FAliPlayer.platformVersion, '42'); 22 | // }); 23 | //} 24 | --------------------------------------------------------------------------------