我正在使用youtube API并执行了本教程中的说明:
http://javatechig.com/android/youtubeplayerview-example-in-android-using-youtube-api
一切都很好,但是当我没有全屏时,视频每秒都会停止。 这就像它播放1秒钟,停止,然后我必须再次按下播放按钮,然后它会在1秒后再次停止。 在全屏幕上,它播放完美。 我100%确定它不是互联网连接,因为我尝试了很多连接,它只能在全屏播放。 知道如何解决这个问题吗?
编辑:这不是手机,我在Nexus 5,索尼Xperia z1,HTC One,一些三星Galaxies上试过。 我多次重新检查代码,它完全相同,甚至是教程的复制粘贴。 当它不在全屏时它仍然停止。 我只使用了本教程,因为我想在将其嵌入到我的主项目之前确保它有效。
I'm using the youtube API and I did the instructions from this tutorial:
http://javatechig.com/android/youtubeplayerview-example-in-android-using-youtube-api
All is well, but when I'm not on full screen, the video keeps stopping every second. It's like it plays for 1 second, stops, then I have to press the play button again, then it will stop again after 1 second. On full screen, it plays perfectly. I'm 100% sure it's not the internet connection because I tried it with many connections and it ONLY plays properly on full screen. Any idea how I can fix this?
EDIT: It's not the phone either, I tried it on a Nexus 5, Sony Xperia z1, HTC One, a number of Samsung Galaxies. I rechecked the code multiple times, it's exactly the same, even did a copy paste of the tutorial. It still stops when it's not on full screen. I only used the tutorial, since I wanted to make sure it works before embedding it to my main project.
最满意答案
我通过移除youtube视频播放器中的填充来解决我的问题。 它现在无论方向如何都能完美呈现。
I solved my problem by removing the padding in the youtube video player. It now plays perfectly regardless of orientation.
更多推荐
发布评论