Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tx_player_fork
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
tx_player_fork
Commits
d685f35b
Unverified
提交
d685f35b
authored
9月 24, 2021
作者:
Dokieyang
提交者:
GitHub
9月 24, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11 from 673697831/main
解决iOS横屏下布局异常问题
上级
ba13f0f5
9a4b446b
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
92 行增加
和
2 行删除
+92
-2
SuperPlatformPlayerView.m
Flutter/ios/Classes/SuperPlatformPlayerView.m
+92
-2
没有找到文件。
Flutter/ios/Classes/SuperPlatformPlayerView.m
浏览文件 @
d685f35b
...
...
@@ -8,8 +8,12 @@
#import "SuperPlatformPlayerView.h"
#import "SuperPlayer.h"
#import "FTXBasePlayer.h"
#import "FTXPlayerEventSinkQueue.h"
@interface
SuperPlatformPlayerView
()
<
SuperPlayerDelegate
>
@interface
SuperPlatformPlayerView
()
<
SuperPlayerDelegate
,
FlutterStreamHandler
>
{
FTXPlayerEventSinkQueue
*
_eventSink
;
}
@property
(
nonatomic
,
strong
)
SuperPlayerView
*
realPlayerView
;
@property
(
nonatomic
,
strong
)
UIView
*
playerFatherView
;
...
...
@@ -85,12 +89,13 @@
{
if
(
self
=
[
self
init
])
{
__weak
typeof
(
self
)
weakSelf
=
self
;
_eventSink
=
[
FTXPlayerEventSinkQueue
new
];
_methodChannel
=
[
FlutterMethodChannel
methodChannelWithName
:[
@"cloud.tencent.com/superPlayer/"
stringByAppendingString
:[
NSString
stringWithFormat
:
@"%@"
,
@
(
viewId
)]]
binaryMessenger
:[
registrar
messenger
]];
[
_methodChannel
setMethodCallHandler
:
^
(
FlutterMethodCall
*
_Nonnull
call
,
FlutterResult
_Nonnull
result
)
{
[
weakSelf
handleMethodCall
:
call
result
:
result
];
}];
_eventChannel
=
[
FlutterEventChannel
eventChannelWithName
:[
@"cloud.tencent.com/superPlayer/event/"
stringByAppendingString
:[
NSString
stringWithFormat
:
@"%@"
,
@
(
viewId
)]]
binaryMessenger
:[
registrar
messenger
]];
//
[_eventChannel setStreamHandler:self];
[
_eventChannel
setStreamHandler
:
self
];
}
return
self
;
...
...
@@ -188,6 +193,21 @@
self
.
realPlayerView
.
loop
=
bLoop
;
}
#pragma mark - FlutterStreamHandler
-
(
FlutterError
*
_Nullable
)
onListenWithArguments
:
(
id
_Nullable
)
arguments
eventSink
:
(
FlutterEventSink
)
events
{
[
_eventSink
setDelegate
:
events
];
return
nil
;
}
-
(
FlutterError
*
_Nullable
)
onCancelWithArguments
:
(
id
_Nullable
)
arguments
{
[
_eventSink
setDelegate
:
nil
];
return
nil
;
}
#pragma mark -
-
(
void
)
handleMethodCall
:
(
FlutterMethodCall
*
)
call
result
:
(
FlutterResult
)
result
...
...
@@ -246,6 +266,8 @@
[
self
.
playerFatherView
addSubview
:
_realPlayerView
];
}
return
_realPlayerView
;
}
...
...
@@ -270,7 +292,13 @@
/// 全屏改变通知
-
(
void
)
superPlayerFullScreenChanged
:
(
SuperPlayerView
*
)
player
{
UIInterfaceOrientation
orientation
=
[
UIApplication
sharedApplication
].
statusBarOrientation
;
if
(
orientation
==
UIInterfaceOrientationPortrait
)
{
[
_eventSink
success
:
@"onStopFullScreenPlay"
];
}
else
{
[
_eventSink
success
:
@"onStartFullScreenPlay"
];
}
}
/// 播放开始通知
...
...
@@ -292,4 +320,66 @@
}
// 需要通知到父view的事件在此添加
+
(
UINavigationController
*
)
currentNavigationController
{
UINavigationController
*
currentNav
=
[
self
getNearestNavigation
:[
self
appRootViewController
]];
do
{
UINavigationController
*
subNav
=
[
self
getNearestNavigation
:[
currentNav
.
viewControllers
lastObject
]];
if
(
subNav
)
{
currentNav
=
subNav
;
}
else
{
break
;
}
}
while
(
1
)
;
return
currentNav
;
}
+
(
UIViewController
*
)
topViewController
{
return
[
self
topViewController
:[
self
appRootViewController
]];
}
+
(
UINavigationController
*
)
getNearestNavigation
:
(
UIViewController
*
)
rootViewController
{
if
([
rootViewController
isKindOfClass
:[
UINavigationController
class
]])
{
return
(
UINavigationController
*
)
rootViewController
;
}
if
([
rootViewController
isKindOfClass
:[
UITabBarController
class
]])
{
UITabBarController
*
tabController
=
(
UITabBarController
*
)
rootViewController
;
return
[
self
getNearestNavigation
:
tabController
.
selectedViewController
];
}
if
(
rootViewController
.
presentedViewController
)
{
return
[
self
getNearestNavigation
:
rootViewController
.
presentedViewController
];
}
return
nil
;
}
+
(
UIViewController
*
)
topViewController
:
(
UIViewController
*
)
rootViewController
{
if
([
rootViewController
isKindOfClass
:[
UINavigationController
class
]])
{
UINavigationController
*
navigationController
=
(
UINavigationController
*
)
rootViewController
;
return
[
self
topViewController
:[
navigationController
.
viewControllers
lastObject
]];
}
if
([
rootViewController
isKindOfClass
:[
UITabBarController
class
]])
{
UITabBarController
*
tabController
=
(
UITabBarController
*
)
rootViewController
;
return
[
self
topViewController
:
tabController
.
selectedViewController
];
}
if
(
rootViewController
.
presentedViewController
)
{
return
[
self
topViewController
:
rootViewController
.
presentedViewController
];
}
return
rootViewController
;
}
+
(
UIViewController
*
)
appRootViewController
{
UIViewController
*
root
=
[
UIApplication
sharedApplication
].
keyWindow
.
rootViewController
;
if
(
!
root
)
{
root
=
[
UIApplication
sharedApplication
].
delegate
.
window
.
rootViewController
;
}
return
root
;
}
@end
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论