播放器不响应或展示iOS应用程序

发布于 2025-02-13 12:59:40 字数 931 浏览 0 评论 0原文

iOS应用调用URL视频文件,但没有播放器可以观看视频。 debug屏幕在这里

  if([_mServiceID isEqualToString:@"movFilePlay"] == YES)
    {
        NSString* path = [StandardPlugin.FCM_URL stringByAppendingString:[dic strValueForKey:@"filePath"]];
        //NSString *path = [[NSBundle mainBundle]bundlePath];
        NSURL *filePath = [NSURL fileURLWithPath:path];
        AVPlayer *player =[AVPlayer playerWithURL:filePath];
        UIPageViewController *controller= [[UIPageViewController alloc]init];
        //controller.player = player;
        
        [self.playerViewController addChildViewController:controller];
       // controller.player = player;
        [player play];

当我按下文件以打开视频加载以进行第二秒,并且播放器将消失。请帮我谢谢! iPhone creen有一个微小的视频图片

IOS app calling url video file but no player to see the video.
debug screen is here

  if([_mServiceID isEqualToString:@"movFilePlay"] == YES)
    {
        NSString* path = [StandardPlugin.FCM_URL stringByAppendingString:[dic strValueForKey:@"filePath"]];
        //NSString *path = [[NSBundle mainBundle]bundlePath];
        NSURL *filePath = [NSURL fileURLWithPath:path];
        AVPlayer *player =[AVPlayer playerWithURL:filePath];
        UIPageViewController *controller= [[UIPageViewController alloc]init];
        //controller.player = player;
        
        [self.playerViewController addChildViewController:controller];
       // controller.player = player;
        [player play];

when I press the file to open video loads for a second and player will disappear. Please help me thanks!
Iphone creen there is tiny picture of video

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

嘿咻 2025-02-20 12:59:40
//  找的链接,可能已过期
NSString* onlineVideoFilePathStr = @"http://vodkgeyttp9.vod.126.net/vodkgeyttp8/pLe5UjdH_7088357_hd.mp4?wsSecret=3407504c27d588bd72f45562e491ef19&wsTime=1559208462&ext=NnR5gMvHcZNcbCz592mDGUGuDOFN18isir07K1EOfL3DA%2FLg%2FvnQozcajtXTmTYynMXslak4S5ceCtQtxSBm80drT0XNo7yBQA%2FXVpOSilHsKsAGdInnG51QYQ7oEjcAhYcDl8crv%2Fb%2FDUIrVdVC5nHgE0%2FmBeAQblajNfkskgDcbRj2543qIHELWaYB6Yvxn5x%2BlNAmBadQ%2FibVtO3RJTx6xTwPSZnvT7ipiNC1OU83ohkF0TdctDfYv6C69xA1";
NSURL* videoUrl = [NSURL URLWithString:onlineVideoFilePathStr];

AVPlayerItem* playerItem = [[AVPlayerItem alloc] initWithURL:videoUrl];
_player = [[AVPlayer alloc] initWithPlayerItem:playerItem];

[self.player play];
//  找的链接,可能已过期
NSString* onlineVideoFilePathStr = @"http://vodkgeyttp9.vod.126.net/vodkgeyttp8/pLe5UjdH_7088357_hd.mp4?wsSecret=3407504c27d588bd72f45562e491ef19&wsTime=1559208462&ext=NnR5gMvHcZNcbCz592mDGUGuDOFN18isir07K1EOfL3DA%2FLg%2FvnQozcajtXTmTYynMXslak4S5ceCtQtxSBm80drT0XNo7yBQA%2FXVpOSilHsKsAGdInnG51QYQ7oEjcAhYcDl8crv%2Fb%2FDUIrVdVC5nHgE0%2FmBeAQblajNfkskgDcbRj2543qIHELWaYB6Yvxn5x%2BlNAmBadQ%2FibVtO3RJTx6xTwPSZnvT7ipiNC1OU83ohkF0TdctDfYv6C69xA1";
NSURL* videoUrl = [NSURL URLWithString:onlineVideoFilePathStr];

AVPlayerItem* playerItem = [[AVPlayerItem alloc] initWithURL:videoUrl];
_player = [[AVPlayer alloc] initWithPlayerItem:playerItem];

[self.player play];
樱桃奶球 2025-02-20 12:59:40

解决方案

html5视频标签 - > Loop Muted Autoplay PlaySinline

刚刚在视频标签中的网页中添加了这些代码。

Solution

HTML5 video tag -> loop muted autoplay playsinline

Just added these codes in web page in video tag.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文