diff --git a/Example/SellyCloudSDK.xcodeproj/project.pbxproj b/Example/SellyCloudSDK.xcodeproj/project.pbxproj index 3a4cc95..f8e5f0d 100644 --- a/Example/SellyCloudSDK.xcodeproj/project.pbxproj +++ b/Example/SellyCloudSDK.xcodeproj/project.pbxproj @@ -12,6 +12,8 @@ 3C0F91622EF39F0000680CB7 /* SCNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C0F91612EF39F0000680CB7 /* SCNavigationController.m */; }; 3C139E642F56822C00CC9371 /* Kiwi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C139E632F56822C00CC9371 /* Kiwi.framework */; }; 3C139E662F5682D400CC9371 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C139E652F5682D400CC9371 /* libc++.tbd */; }; + 3C13AFC82F56FC6C00CC9371 /* test_mp4.MP4 in Resources */ = {isa = PBXBuildFile; fileRef = 3C13AFC72F56FC6C00CC9371 /* test_mp4.MP4 */; }; + 3C13AFCA2F57020D00CC9371 /* test_mov.MOV in Resources */ = {isa = PBXBuildFile; fileRef = 3C13AFC92F57020D00CC9371 /* test_mov.MOV */; }; 3C1851E02ECDE7690022F536 /* SellyCallPiPManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C1851DF2ECDE7690022F536 /* SellyCallPiPManager.m */; }; 3C312FFC2F021216006C90A4 /* AVLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C312FF92F021216006C90A4 /* AVLoginViewController.m */; }; 3C312FFD2F021216006C90A4 /* AVUserManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C312FFB2F021216006C90A4 /* AVUserManager.m */; }; @@ -144,6 +146,8 @@ 3C0F91612EF39F0000680CB7 /* SCNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SCNavigationController.m; sourceTree = ""; }; 3C139E632F56822C00CC9371 /* Kiwi.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Kiwi.framework; sourceTree = ""; }; 3C139E652F5682D400CC9371 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; }; + 3C13AFC72F56FC6C00CC9371 /* test_mp4.MP4 */ = {isa = PBXFileReference; lastKnownFileType = file; path = test_mp4.MP4; sourceTree = ""; }; + 3C13AFC92F57020D00CC9371 /* test_mov.MOV */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = test_mov.MOV; sourceTree = ""; }; 3C1851DE2ECDE7690022F536 /* SellyCallPiPManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SellyCallPiPManager.h; sourceTree = ""; }; 3C1851DF2ECDE7690022F536 /* SellyCallPiPManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SellyCallPiPManager.m; sourceTree = ""; }; 3C312FF82F021216006C90A4 /* AVLoginViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AVLoginViewController.h; sourceTree = ""; }; @@ -505,6 +509,8 @@ 3CC7330A2EF0EEF4000027B2 /* Views */, 3C7EAE1F2E4D7E730046553F /* test.jpg */, 3C075C2A2E3873A800591B2D /* test1.png */, + 3C13AFC72F56FC6C00CC9371 /* test_mp4.MP4 */, + 3C13AFC92F57020D00CC9371 /* test_mov.MOV */, 3C8AC2172EBC57B7000A58F1 /* call.caf */, 6003F59C195388D20070C39A /* SCAppDelegate.h */, 6003F59D195388D20070C39A /* SCAppDelegate.m */, @@ -717,7 +723,9 @@ buildActionMask = 2147483647; files = ( 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, + 3C13AFC82F56FC6C00CC9371 /* test_mp4.MP4 in Resources */, 3C8AC1F22EB85E4E000A58F1 /* SellyVideoCallViewController.xib in Resources */, + 3C13AFCA2F57020D00CC9371 /* test_mov.MOV in Resources */, 3C7EAE202E4D7E730046553F /* test.jpg in Resources */, 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 3C4BF3152EC56BD70095F93A /* SellyVideoCallConferenceController.xib in Resources */, diff --git a/Example/SellyCloudSDK/Play/SCVodVideoPlayerViewController.m b/Example/SellyCloudSDK/Play/SCVodVideoPlayerViewController.m index 24befa5..221df6e 100644 --- a/Example/SellyCloudSDK/Play/SCVodVideoPlayerViewController.m +++ b/Example/SellyCloudSDK/Play/SCVodVideoPlayerViewController.m @@ -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 { diff --git a/Example/SellyCloudSDK/test_mov.MOV b/Example/SellyCloudSDK/test_mov.MOV new file mode 100644 index 0000000..5feac99 Binary files /dev/null and b/Example/SellyCloudSDK/test_mov.MOV differ diff --git a/Example/SellyCloudSDK/test_mp4.MP4 b/Example/SellyCloudSDK/test_mp4.MP4 new file mode 100644 index 0000000..d5724a4 Binary files /dev/null and b/Example/SellyCloudSDK/test_mp4.MP4 differ diff --git a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyVodVideoPlayer.h b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyVodVideoPlayer.h index 42d69d5..bace9fa 100644 --- a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyVodVideoPlayer.h +++ b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/Headers/SellyVodVideoPlayer.h @@ -11,6 +11,13 @@ NS_ASSUME_NONNULL_BEGIN @interface SellyVodVideoPlayer : NSObject +/** + 点播开始播放视频 + @param url 播放地址,支持以下格式: + - 网络地址:http(s)://xxx.mp4 + - 本地文件路径:/var/mobile/.../video.mp4 + - 本地文件URL:file:///var/mobile/.../video.mp4 + */ - (void)startPlayUrl:(NSString *)url; - (void)resume; diff --git a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/SellyCloudSDK b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/SellyCloudSDK index 87ad211..74c3037 100755 Binary files a/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/SellyCloudSDK and b/Example/SubModules/SellyCloudSDK/SellyCloudSDK/sdk/SellyCloudSDK.framework/SellyCloudSDK differ