vod完善播放本地视频
This commit is contained in:
@@ -91,23 +91,7 @@
|
||||
|
||||
// 创建 SCPlayerConfig
|
||||
SCPlayerConfig *config = [[SCPlayerConfig alloc] init];
|
||||
config.streamId = stream.stream;
|
||||
|
||||
// 根据 playProtocol 字符串设置协议类型
|
||||
NSString *protocol = stream.play_protocol.lowercaseString;
|
||||
if ([protocol isEqualToString:@"rtc"] || [protocol isEqualToString:@"webrtc"]) {
|
||||
config.protocol = SellyLiveMode_RTC;
|
||||
} else if ([protocol isEqualToString:@"rtmp"]) {
|
||||
config.protocol = SellyLiveMode_RTMP;
|
||||
} else {
|
||||
// 默认使用 RTMP(flv、hls 等也使用 RTMP 模式)
|
||||
config.protocol = SellyLiveMode_RTMP;
|
||||
}
|
||||
|
||||
NSLog(@"🔄 转换 StreamModel -> PlayerConfig: stream=%@, protocol=%@ (%@)",
|
||||
config.streamId,
|
||||
stream.play_protocol,
|
||||
config.protocol == SellyLiveMode_RTC ? @"RTC" : @"RTMP");
|
||||
config.streamId = stream.stream ? stream.stream:stream.url;
|
||||
|
||||
// 保存配置并开始播放
|
||||
self.currentConfig = config;
|
||||
@@ -270,8 +254,10 @@
|
||||
SCPlayerConfig *config = self.currentConfig;
|
||||
if ([config.streamId hasPrefix:@"rtmp://"] ||
|
||||
[config.streamId hasPrefix:@"http://"] ||
|
||||
[config.streamId hasPrefix:@"https://"]) {
|
||||
// 完整 URL
|
||||
[config.streamId hasPrefix:@"https://"] ||
|
||||
[config.streamId hasPrefix:@"file://"] ||
|
||||
[config.streamId hasPrefix:@"/"]) {
|
||||
// 完整 URL 或本地文件路径
|
||||
[self.debugView appendLog:[NSString stringWithFormat:@"开始播放 URL: %@", config.streamId] withPrefix:@"▶️"];
|
||||
[self.player startPlayUrl:config.streamId];
|
||||
} else {
|
||||
|
||||
BIN
Example/SellyCloudSDK/test_mov.MOV
Normal file
BIN
Example/SellyCloudSDK/test_mov.MOV
Normal file
Binary file not shown.
BIN
Example/SellyCloudSDK/test_mp4.MP4
Normal file
BIN
Example/SellyCloudSDK/test_mp4.MP4
Normal file
Binary file not shown.
Reference in New Issue
Block a user