简体   繁体   English

Exo 播放器在使用 URL 播放时挂起并崩溃

[英]Exo player hangs and crashes when played with URL

Sometimes Exo player hangs and crashes happen in my app.有时 Exo 播放器挂起并在我的应用程序中发生崩溃。 I think I used a live URL in the player so there is some time-out issue.我想我在播放器中使用了实时 URL,因此存在一些超时问题。

 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();

在此处输入图像描述

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.此处显示的错误确实是套接字读取超时 - 为了验证没有其他潜在问题,您可以通过将您的 url(和任何 DRM 许可证 URL)添加到那里的测试 json 数据文件中来在演示资源管理器中测试。

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 - ie 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.如果您可以访问视频服务器,那么检查日志可能是最好的起点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM