vod完善播放本地视频
This commit is contained in:
@@ -12,6 +12,8 @@
|
|||||||
3C0F91622EF39F0000680CB7 /* SCNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C0F91612EF39F0000680CB7 /* SCNavigationController.m */; };
|
3C0F91622EF39F0000680CB7 /* SCNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C0F91612EF39F0000680CB7 /* SCNavigationController.m */; };
|
||||||
3C139E642F56822C00CC9371 /* Kiwi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C139E632F56822C00CC9371 /* Kiwi.framework */; };
|
3C139E642F56822C00CC9371 /* Kiwi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C139E632F56822C00CC9371 /* Kiwi.framework */; };
|
||||||
3C139E662F5682D400CC9371 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 3C139E652F5682D400CC9371 /* libc++.tbd */; };
|
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 */; };
|
3C1851E02ECDE7690022F536 /* SellyCallPiPManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C1851DF2ECDE7690022F536 /* SellyCallPiPManager.m */; };
|
||||||
3C312FFC2F021216006C90A4 /* AVLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C312FF92F021216006C90A4 /* AVLoginViewController.m */; };
|
3C312FFC2F021216006C90A4 /* AVLoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C312FF92F021216006C90A4 /* AVLoginViewController.m */; };
|
||||||
3C312FFD2F021216006C90A4 /* AVUserManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 3C312FFB2F021216006C90A4 /* AVUserManager.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 = "<group>"; };
|
3C0F91612EF39F0000680CB7 /* SCNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SCNavigationController.m; sourceTree = "<group>"; };
|
||||||
3C139E632F56822C00CC9371 /* Kiwi.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Kiwi.framework; sourceTree = "<group>"; };
|
3C139E632F56822C00CC9371 /* Kiwi.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = Kiwi.framework; sourceTree = "<group>"; };
|
||||||
3C139E652F5682D400CC9371 /* libc++.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = "libc++.tbd"; path = "usr/lib/libc++.tbd"; sourceTree = SDKROOT; };
|
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 = "<group>"; };
|
||||||
|
3C13AFC92F57020D00CC9371 /* test_mov.MOV */ = {isa = PBXFileReference; lastKnownFileType = video.quicktime; path = test_mov.MOV; sourceTree = "<group>"; };
|
||||||
3C1851DE2ECDE7690022F536 /* SellyCallPiPManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SellyCallPiPManager.h; sourceTree = "<group>"; };
|
3C1851DE2ECDE7690022F536 /* SellyCallPiPManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SellyCallPiPManager.h; sourceTree = "<group>"; };
|
||||||
3C1851DF2ECDE7690022F536 /* SellyCallPiPManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SellyCallPiPManager.m; sourceTree = "<group>"; };
|
3C1851DF2ECDE7690022F536 /* SellyCallPiPManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SellyCallPiPManager.m; sourceTree = "<group>"; };
|
||||||
3C312FF82F021216006C90A4 /* AVLoginViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AVLoginViewController.h; sourceTree = "<group>"; };
|
3C312FF82F021216006C90A4 /* AVLoginViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AVLoginViewController.h; sourceTree = "<group>"; };
|
||||||
@@ -505,6 +509,8 @@
|
|||||||
3CC7330A2EF0EEF4000027B2 /* Views */,
|
3CC7330A2EF0EEF4000027B2 /* Views */,
|
||||||
3C7EAE1F2E4D7E730046553F /* test.jpg */,
|
3C7EAE1F2E4D7E730046553F /* test.jpg */,
|
||||||
3C075C2A2E3873A800591B2D /* test1.png */,
|
3C075C2A2E3873A800591B2D /* test1.png */,
|
||||||
|
3C13AFC72F56FC6C00CC9371 /* test_mp4.MP4 */,
|
||||||
|
3C13AFC92F57020D00CC9371 /* test_mov.MOV */,
|
||||||
3C8AC2172EBC57B7000A58F1 /* call.caf */,
|
3C8AC2172EBC57B7000A58F1 /* call.caf */,
|
||||||
6003F59C195388D20070C39A /* SCAppDelegate.h */,
|
6003F59C195388D20070C39A /* SCAppDelegate.h */,
|
||||||
6003F59D195388D20070C39A /* SCAppDelegate.m */,
|
6003F59D195388D20070C39A /* SCAppDelegate.m */,
|
||||||
@@ -717,7 +723,9 @@
|
|||||||
buildActionMask = 2147483647;
|
buildActionMask = 2147483647;
|
||||||
files = (
|
files = (
|
||||||
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
|
873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */,
|
||||||
|
3C13AFC82F56FC6C00CC9371 /* test_mp4.MP4 in Resources */,
|
||||||
3C8AC1F22EB85E4E000A58F1 /* SellyVideoCallViewController.xib in Resources */,
|
3C8AC1F22EB85E4E000A58F1 /* SellyVideoCallViewController.xib in Resources */,
|
||||||
|
3C13AFCA2F57020D00CC9371 /* test_mov.MOV in Resources */,
|
||||||
3C7EAE202E4D7E730046553F /* test.jpg in Resources */,
|
3C7EAE202E4D7E730046553F /* test.jpg in Resources */,
|
||||||
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
|
71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */,
|
||||||
3C4BF3152EC56BD70095F93A /* SellyVideoCallConferenceController.xib in Resources */,
|
3C4BF3152EC56BD70095F93A /* SellyVideoCallConferenceController.xib in Resources */,
|
||||||
|
|||||||
@@ -91,23 +91,7 @@
|
|||||||
|
|
||||||
// 创建 SCPlayerConfig
|
// 创建 SCPlayerConfig
|
||||||
SCPlayerConfig *config = [[SCPlayerConfig alloc] init];
|
SCPlayerConfig *config = [[SCPlayerConfig alloc] init];
|
||||||
config.streamId = stream.stream;
|
config.streamId = stream.stream ? stream.stream:stream.url;
|
||||||
|
|
||||||
// 根据 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");
|
|
||||||
|
|
||||||
// 保存配置并开始播放
|
// 保存配置并开始播放
|
||||||
self.currentConfig = config;
|
self.currentConfig = config;
|
||||||
@@ -270,8 +254,10 @@
|
|||||||
SCPlayerConfig *config = self.currentConfig;
|
SCPlayerConfig *config = self.currentConfig;
|
||||||
if ([config.streamId hasPrefix:@"rtmp://"] ||
|
if ([config.streamId hasPrefix:@"rtmp://"] ||
|
||||||
[config.streamId hasPrefix:@"http://"] ||
|
[config.streamId hasPrefix:@"http://"] ||
|
||||||
[config.streamId hasPrefix:@"https://"]) {
|
[config.streamId hasPrefix:@"https://"] ||
|
||||||
// 完整 URL
|
[config.streamId hasPrefix:@"file://"] ||
|
||||||
|
[config.streamId hasPrefix:@"/"]) {
|
||||||
|
// 完整 URL 或本地文件路径
|
||||||
[self.debugView appendLog:[NSString stringWithFormat:@"开始播放 URL: %@", config.streamId] withPrefix:@"▶️"];
|
[self.debugView appendLog:[NSString stringWithFormat:@"开始播放 URL: %@", config.streamId] withPrefix:@"▶️"];
|
||||||
[self.player startPlayUrl:config.streamId];
|
[self.player startPlayUrl:config.streamId];
|
||||||
} else {
|
} 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.
@@ -11,6 +11,13 @@
|
|||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface SellyVodVideoPlayer : NSObject
|
@interface SellyVodVideoPlayer : NSObject
|
||||||
|
/**
|
||||||
|
点播开始播放视频
|
||||||
|
@param url 播放地址,支持以下格式:
|
||||||
|
- 网络地址:http(s)://xxx.mp4
|
||||||
|
- 本地文件路径:/var/mobile/.../video.mp4
|
||||||
|
- 本地文件URL:file:///var/mobile/.../video.mp4
|
||||||
|
*/
|
||||||
- (void)startPlayUrl:(NSString *)url;
|
- (void)startPlayUrl:(NSString *)url;
|
||||||
|
|
||||||
- (void)resume;
|
- (void)resume;
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user