Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tx_player_fork
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
蒋俊
tx_player_fork
Commits
01c1909d
提交
01c1909d
authored
9月 02, 2022
作者:
kongdywang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix bug about volume and live
上级
efb9316d
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
22 行增加
和
12 行删除
+22
-12
FTXAudioManager.h
Flutter/ios/Classes/FTXAudioManager.h
+2
-4
FTXAudioManager.m
Flutter/ios/Classes/FTXAudioManager.m
+11
-4
FTXTransformation.m
Flutter/ios/Classes/FTXTransformation.m
+5
-1
SuperPlayerPlugin.m
Flutter/ios/Classes/SuperPlayerPlugin.m
+4
-3
没有找到文件。
Flutter/ios/Classes/FTXAudioManager.h
浏览文件 @
01c1909d
...
...
@@ -12,10 +12,8 @@
-
(
void
)
setVolumeUIVisible
:(
BOOL
)
volumeUIVisible
;
-
(
void
)
registerVolumeChangeListener
:(
_Nonnull
id
)
observer
selector
:(
_Nonnull
SEL
)
aSelector
name
:(
nullable
NSNotificationName
)
aName
object
:(
nullable
id
)
anObject
;
-
(
void
)
registerVolumeChangeListener
:(
_Nonnull
id
)
observer
;
-
(
void
)
destory
:(
_Nonnull
id
)
observer
name
:(
nullable
NSNotificationName
)
aName
object
:(
nullable
id
)
anObject
;
-
(
void
)
destory
:(
_Nonnull
id
)
observer
;
@end
Flutter/ios/Classes/FTXAudioManager.m
浏览文件 @
01c1909d
...
...
@@ -5,7 +5,10 @@
@implementation
FTXAudioManager
UISlider
*
_volumeSlider
;
MPVolumeView
*
volumeView
;
AVAudioSession
*
audioSession
;
NSString
*
const
LOW_VERSION_NOTIFCATION_NAME
=
@"AVSystemController_SystemVolumeDidChangeNotification"
;
NSString
*
const
NOTIFCATION_NAME
=
@"SystemVolumeDidChange"
;
-
(
instancetype
)
init
{
...
...
@@ -24,6 +27,9 @@
break
;
}
}
audioSession
=
[
AVAudioSession
sharedInstance
];
[
audioSession
setActive
:
true
error
:
nil
];
}
return
self
;
};
...
...
@@ -48,17 +54,18 @@
volumeView
.
hidden
=
!
volumeUIVisible
;
}
-
(
void
)
registerVolumeChangeListener
:
(
id
)
observer
selector
:
(
SEL
)
aSelector
name
:
(
NSNotificationName
)
aName
object
:
(
id
)
anObject
-
(
void
)
registerVolumeChangeListener
:
(
id
)
observer
{
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
observer
selector
:
aSelector
name
:
aName
object
:
anObject
];
// destory volume observer
[
audioSession
addObserver
:
observer
forKeyPath
:
@"outputVolume"
options
:
NSKeyValueObservingOptionNew
|
NSKeyValueObservingOptionOld
context
:
nil
];
}
-
(
void
)
destory
:
(
id
)
observer
name
:
(
NSNotificationName
)
aName
object
:
(
id
)
anObject
-
(
void
)
destory
:
(
id
)
observer
{
// destory volume view
[
volumeView
removeFromSuperview
];
// destory volume observer
[
[
NSNotificationCenter
defaultCenter
]
removeObserver
:
observer
name
:
aName
object
:
anObject
];
[
audioSession
removeObserver
:
observer
forKeyPath
:
@"outputVolume"
context
:
nil
];
}
@end
Flutter/ios/Classes/FTXTransformation.m
浏览文件 @
01c1909d
...
...
@@ -62,7 +62,11 @@
playConfig
.
enableAEC
=
[
args
[
@"config"
][
@"enableAec"
]
boolValue
];
playConfig
.
enableMessage
=
[
args
[
@"config"
][
@"enableMessage"
]
intValue
];
playConfig
.
enableMetaData
=
[
args
[
@"config"
][
@"enableMetaData"
]
intValue
];
playConfig
.
flvSessionKey
=
[
args
[
@"config"
][
@"flvSessionKey"
]
stringValue
];
NSString
*
flvSessionKey
=
args
[
@"config"
][
@"flvSessionKey"
];
if
(
flvSessionKey
!=
nil
&&
flvSessionKey
.
length
>
0
)
{
playConfig
.
flvSessionKey
=
flvSessionKey
;
}
return
playConfig
;
}
...
...
Flutter/ios/Classes/SuperPlayerPlugin.m
浏览文件 @
01c1909d
...
...
@@ -67,7 +67,7 @@ SuperPlayerPlugin* instance;
[
_eventChannel
setStreamHandler
:
self
];
[
_pipEventChannel
setStreamHandler
:
self
];
[
audioManager
registerVolumeChangeListener
:
self
selector
:
@selector
(
systemVolumeDidChangeNoti
:
)
name
:
@"AVSystemController_SystemVolumeDidChangeNotification"
object
:
nil
];
[
audioManager
registerVolumeChangeListener
:
self
];
_FTXDownloadManager
=
[[
FTXDownloadManager
alloc
]
initWithRegistrar
:
registrar
];
// orientation
mCurrentOrientation
=
ORIENTATION_PORTRAIT_UP
;
...
...
@@ -79,7 +79,8 @@ SuperPlayerPlugin* instance;
return
self
;
}
-
(
void
)
systemVolumeDidChangeNoti
:(
NSNotification
*
)
noti
{
-
(
void
)
observeValueForKeyPath
:(
NSString
*
)
keyPath
ofObject
:(
id
)
object
change
:(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:(
void
*
)
context
{
[
_eventSink
success
:[
SuperPlayerPlugin
getParamsWithEvent
:
EVENT_VOLUME_CHANGED
withParams
:@{}]];
}
...
...
@@ -207,7 +208,7 @@ SuperPlayerPlugin* instance;
-
(
void
)
destory
{
[
audioManager
destory
:
self
name
:
@"AVSystemController_SystemVolumeDidChangeNotification"
object
:
nil
];
[
audioManager
destory
:
self
];
}
#pragma mark - FlutterStreamHandler
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论