提交 a92e1e8b authored 作者: kongdywang's avatar kongdywang

1、android adapt flutter new gradle environment

2、fix ios receive first frame event before play when prePlay 3、fix player will show loading when enter fullScreen that in prePlay status
上级 56225e26
......@@ -5,7 +5,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.0'
classpath 'com.android.tools.build:gradle:7.2.0'
}
}
......
......@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
......@@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>9.0</string>
<string>11.0</string>
</dict>
</plist>
# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'
# platform :ios, '11.0'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
......
......@@ -371,7 +371,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
......@@ -450,7 +450,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
......@@ -500,7 +500,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
......
......@@ -54,5 +54,7 @@
<false/>
<key>io.flutter.embedded_views_preview</key>
<true/>
<key>UIApplicationSupportsIndirectInputEvents</key>
<true/>
</dict>
</plist>
......@@ -396,12 +396,6 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
(void **)&_latestPixelBuffer)) {
pixelBuffer = _latestPixelBuffer;
}
dispatch_async(playerMainqueue, ^{
if(!self->isVideoFirstFrameReceived && nil != pixelBuffer) {
[self->_eventSink success:[FTXVodPlayer getParamsWithEvent:CODE_ON_RECEIVE_FIRST_FRAME withParams:@{@"EVT_WIDTH":@(self->videoWidth.intValue), @"EVT_HEIGHT":@(self->videoHeight.intValue),@"EVT_PARAM1":@(self->videoWidth.intValue), @"EVT_PARAM2":@(self->videoHeight.intValue)}]];
self->isVideoFirstFrameReceived = true;
}
});
return pixelBuffer;
}
......@@ -412,11 +406,12 @@ static const int CODE_ON_RECEIVE_FIRST_FRAME = 2003;
// Hand over the first frame event timing to Flutter for shared texture processing.
if (EvtID == CODE_ON_RECEIVE_FIRST_FRAME) {
currentPlayTime = 0;
dispatch_async(playerMainqueue, ^{
self->videoWidth = param[@"EVT_WIDTH"];
self->videoHeight = param[@"EVT_HEIGHT"];
});
return;
NSMutableDictionary *mutableDic = param.mutableCopy;
self->videoWidth = param[@"EVT_WIDTH"];
self->videoHeight = param[@"EVT_HEIGHT"];
mutableDic[@"EVT_PARAM1"] = self->videoWidth;
mutableDic[@"EVT_PARAM2"] = self->videoHeight;
param = mutableDic;
} else if(EvtID == PLAY_EVT_CHANGE_RESOLUTION) {
dispatch_async(playerMainqueue, ^{
self->videoWidth = param[@"EVT_WIDTH"];
......
......@@ -3,6 +3,7 @@ part of demo_super_player_lib;
enum SuperPlayerState {
INIT, // Initial state
PREPARED, // prepared
PLAYING, // Playing
PAUSE, // Paused
LOADING, // Buffering
......
......@@ -133,6 +133,8 @@ class SuperPlayerController {
_vodPlayerController.resume();
}
videoDuration = await _vodPlayerController.getDuration();
currentDuration = await _vodPlayerController.getCurrentPlaybackTime();
_updatePlayerState(SuperPlayerState.PREPARED);
break;
case TXVodPlayEvent.PLAY_EVT_PLAY_LOADING: // PLAY_EVT_PLAY_LOADING
if (playerState == SuperPlayerState.PAUSE) {
......@@ -569,6 +571,8 @@ class SuperPlayerController {
playerState = state;
switch (state) {
case SuperPlayerState.INIT:
break;
case SuperPlayerState.PREPARED:
_observer?.onPlayPrepare();
break;
case SuperPlayerState.PLAYING:
......
......@@ -158,7 +158,7 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs
}, () {
// onPlayPrepare
_isShowCover = true;
_isLoading = true;
_isLoading = false;
_togglePlayUIState(false);
}, (name) {
_togglePlayUIState(true);
......@@ -269,6 +269,10 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs
_isLoading = true;
_coverViewKey.currentState?.hideCover();
break;
case SuperPlayerState.PREPARED:
_isPlaying = false;
_isLoading = false;
break;
case SuperPlayerState.INIT:
_isPlaying = false;
_isLoading = true;
......@@ -600,7 +604,7 @@ class SuperPlayerViewState extends State<SuperPlayerView> with WidgetsBindingObs
int playAction = _playController.videoModel!.playAction;
if (playerState == SuperPlayerState.LOADING && playAction == SuperPlayerModel.PLAY_ACTION_PRELOAD) {
_playController.resume();
} else if (playerState == SuperPlayerState.INIT) {
} else if (playerState == SuperPlayerState.INIT || playerState == SuperPlayerState.PREPARED) {
if (playAction == SuperPlayerModel.PLAY_ACTION_PRELOAD) {
_playController.resume();
} else if (playAction == SuperPlayerModel.PLAY_ACTION_MANUAL_PLAY) {
......@@ -805,16 +809,16 @@ class FullScreenController {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.manual, overlays: SystemUiOverlay.values);
} else if (orientationDirection == TXVodPlayEvent.ORIENTATION_LANDSCAPE_RIGHT) {
enterFullScreen();
SystemChrome.setPreferredOrientations(
Platform.isIOS ? [DeviceOrientation.landscapeRight] : [DeviceOrientation.landscapeLeft]);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
enterFullScreen();
} else if (orientationDirection == TXVodPlayEvent.ORIENTATION_PORTRAIT_DOWN) {
} else if (orientationDirection == TXVodPlayEvent.ORIENTATION_LANDSCAPE_LEFT) {
enterFullScreen();
SystemChrome.setPreferredOrientations(
Platform.isIOS ? [DeviceOrientation.landscapeLeft] : [DeviceOrientation.landscapeRight]);
SystemChrome.setEnabledSystemUIMode(SystemUiMode.immersive);
enterFullScreen();
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论