Vimeo视频停止在Android 6设备上播放 [英] Vimeo video stops playing on Android 6 devices

查看:129
本文介绍了Vimeo视频停止在Android 6设备上播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的应用中播放Vimeo的视频.问题在于,在Android 6设备上,视频会在一段时间后停止播放.在API较低的设备上,一切正常.

I'm trying to play video's from Vimeo in my app. The problem is that on Android 6 devices the video stops playing after a certain time. On devices with a lower API everything plays fine.

  • 时间取决于质量.对于下面提供的网址的视频,播放特定的时间(1到3).视频质量多么低,可以持续播放多长时间.
  • 1到3分钟后,媒体播放器将引发ProtocolException.该应用不会因此而崩溃,但是在播放缓冲的视频片段时视频会冻结. [MediaHTTPConnection] readAt 25182208 / 32768 => java.net.ProtocolException: unexpected end of stream and shows this in de log
  • 视频播放30秒后(缓冲),然后应用程序输出此[MediaPlayer] error (1, -1004)
  • The time depends on the quality. For the video of the provided url's below plays a certain minutes (1 to 3). How lower the video quality how longer it keeps playing.
  • After 1 to 3 minutes the mediaplayer throws an ProtocolException. The app does not crash on this but the video freezes when the buffered video piece is played. [MediaHTTPConnection] readAt 25182208 / 32768 => java.net.ProtocolException: unexpected end of stream and shows this in de log
  • After the exception the video plays 30 seconds (buffered), then the application outputs this [MediaPlayer] error (1, -1004)

我们现在已经通过电子邮件发送了数周的Vimeo支持,但他们无法提供解决方案或可能的原因.现在,在发送了几周的支持服务后,他们说他们不支持Android,但是我们尝试了他们的建议:

We're emailing for weeks now with Vimeo Support but they can't provide a solution or a possible cause. Now after weeks of mailing the support desk says that they're not supporting Android, but we've tried their suggestions:

  • 使用重定向和未重定向的网址

http://player.vimeo.com/external/185069251.hd.mp4?s = fd7b4178a59166b3f636f2e48f1d49b99db66ed2& profile_id = 174 [重定向的网址]

http://player.vimeo.com/external/185069251.hd.mp4?s=fd7b4178a59166b3f636f2e48f1d49b99db66ed2&profile_id=174 [Redirected URL]

https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/01/2013/7/185069251/610514667.m​​p4?token=586a9287_0xbb25f73405c612b30e0c64dc4c3a169e30137f84 [未重定向的网址]

https://fpdl.vimeocdn.com/vimeo-prod-skyfire-std-us/01/2013/7/185069251/610514667.mp4?token=586a9287_0xbb25f73405c612b30e0c64dc4c3a169e30137f84 [Not redirected URL]

  • 使用视频视图代替媒体播放器

  • Use a video view instead of a mediaplayer

我们尝试了本机Android和Xamarin Android实现

We've tried a native Android and a Xamarin Android implementation

尝试下载文件=>可以,但是我们要流式传输,因为某些视频的时间超过了30分钟(> 100mb).取消注释DownLoadActivity中的onCreate中的代码以测试下载.

Try to download the file => this works but we want to stream because some video's are longer then 30 minutes (>100mb). Uncomment the code in the onCreate in the DownLoadActivity to test downloading.

在浏览器中,一切正常.

In the browser everything works fine.

我已经在We-Transfer上放置了一个测试项目,您可以在其中查看问题 https://bazookas.wetransfer.com/downloads/40dadcc8a01f7ebf025345cdf88b731220170102160508/2/2a

I've placed a testproject on We-Transfer where you can see the problem https://bazookas.wetransfer.com/downloads/40dadcc8a01f7ebf025345cdf88b731220170102160508/21970a

推荐答案

HI我也使用Vimeo,但使用了另一种方式. 而且它在任何操作系统上都可以正常工作而没有任何问题. (对于本机Android)

HI in my app I'm also using Vimeo but in another way. And it' working fine without issue in any OS. (For Native Android)

 webView.setWebViewClient(new WebViewClient() {
            public boolean shouldOverrideUrlLoading(WebView view, String url) {
                Log.i("", "Processing webview url click...");
                view.loadUrl(url);
                return true;
            }

            public void onPageFinished(WebView view, String url) {
                Log.i("", "Finished loading URL: " + url);
                Const.disMisProgressdialog();
            }


            @Override
            public void onLoadResource(WebView view, String url) {
                super.onLoadResource(view, url);
            }
        });

        if(windowwidth < 480) {
            webView.loadUrl("https://player.vimeo.com/video/<YOUR VEMIO ID>?player_id=player&autoplay=1&title=0&byline=0&portrait=0&api=1&maxheight=320&maxwidth=480");
        }else{
            webView.loadUrl("https://player.vimeo.com/video/<YOUR VEMIO ID>?player_id=player&autoplay=1&title=0&byline=0&portrait=0&api=1&maxheight=480&maxwidth=800");
        }

对于

窗口宽度:-
int windowwidth = getWindowManager().getDefaultDisplay().getWidth();
int windowheight = getWindowManager().getDefaultDisplay().getHeight();

windowwidth :-
int windowwidth = getWindowManager().getDefaultDisplay().getWidth();
int windowheight = getWindowManager().getDefaultDisplay().getHeight();

这篇关于Vimeo视频停止在Android 6设备上播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆