使用URL播放时,Exo播放器悬挂并撞车

发布于 2025-02-07 09:47:42 字数 870 浏览 2 评论 0原文

有时,Exo播放器会挂起,并且在我的应用中发生崩溃。我认为我在玩家中使用了现场网址,因此存在一些超时问题。

 Uri assetSrtUri = Uri.parse(vvtFilePath);
            MediaItem.SubtitleConfiguration subtitle = new MediaItem.SubtitleConfiguration.Builder(assetSrtUri)
                    .setMimeType(MimeTypes.TEXT_VTT)
                    .setLanguage("en")
                    .setSelectionFlags(C.SELECTION_FLAG_DEFAULT)
                    .build();
    
            MediaItem mediaItem = new MediaItem.Builder()
                    .setUri(uri)
                    .setSubtitleConfigurations(ImmutableList.of(subtitle))
                    .build();
    
            player.setMediaItem(mediaItem);
            player.prepare();

Sometimes Exo player hangs and crashes happen in my app. I think I used a live URL in the player so there is some time-out issue.

 Uri assetSrtUri = Uri.parse(vvtFilePath);
            MediaItem.SubtitleConfiguration subtitle = new MediaItem.SubtitleConfiguration.Builder(assetSrtUri)
                    .setMimeType(MimeTypes.TEXT_VTT)
                    .setLanguage("en")
                    .setSelectionFlags(C.SELECTION_FLAG_DEFAULT)
                    .build();
    
            MediaItem mediaItem = new MediaItem.Builder()
                    .setUri(uri)
                    .setSubtitleConfigurations(ImmutableList.of(subtitle))
                    .build();
    
            player.setMediaItem(mediaItem);
            player.prepare();

enter image description here

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

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

发布评论

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

评论(1

瑾夏年华 2025-02-14 09:47:42

此处显示的错误确实是套接字读取超时 - 要验证,您可以通过将您的URL(和任何DRM许可URL)添加到其中的测试JSON数据文件中,可以在演示资源管理器中测试其他潜在问题。

如果您在本地网络上具有相同的可用源或类似的来源,则可以在本地网络上进行测试。

视频服务器也可能是瓶颈 - 即网络还可以,但是视频服务器过度劳累或有一些故障。如果您可以访问视频服务器,那么检查日志可能是最佳起点。

The error showing here is indeed a socket read timeout - to verify there is not other underlying issues you could test in the demo explorer by adding your url (and any DRM license URL) to the test json data file there.

You could also test on a local network if you have the same source available locally, or a similar source.

It is possible the video server is the bottle neck also - i.e. the network is ok but the video server is overworked or has some fault. If you have access to the video server then checking the logs would likely be the best place to start.

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