vod完善播放本地视频

This commit is contained in:
Caleb
2026-03-03 20:00:58 +08:00
parent cfc6007c59
commit 3d64acb766
6 changed files with 20 additions and 19 deletions

View File

@@ -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 {
// 使 RTMPflvhls 使 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 {