如果我使用youtube-API或在网络视图中展示视频,有什么优点或缺点? [英] what the advantage or disadvantages if i used youtube-API or present the video in a webview

查看:94
本文介绍了如果我使用youtube-API或在网络视图中展示视频,有什么优点或缺点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在YouTube Player API中,当我按全屏显示时,它会从头开始重复播放视频,这对解决此问题有帮助

当我锁定手机(睡眠模式)时,它也停止播放了,我希望它恢复播放.

解决方案

  • 如果您添加全屏显示,则不会向AndroidManifest添加方向标记.基本上默认情况下,它会重新创建活动,然后重新启动.

    <activity
        android:name="MyActivity"
        android:label="@string/app_name"
        android:configChanges="orientation|screenSize" >
    

  • YouTube禁止在睡眠模式或后台运行视频.在 YouTube服务条款中很明显.因此,将没有任何API,并且解决方法将违反TOS.

In YouTube Player API when I press fullscreen it repeats the video from the beginning ,any help to solve this problem

Also when I lock my phone (sleep mode) it stop playing , I want it to resume.

解决方案

  • If you add fullscreen, orientation flags to your AndroidManifest it won't. Basically by default, it recreates the activity, hence restarts.

    <activity
        android:name="MyActivity"
        android:label="@string/app_name"
        android:configChanges="orientation|screenSize" >
    

  • YouTube prohibits running videos in sleep mode, or in background. It's clear in YouTube TOS. Hence there won't be any APIs and doing workarounds will be against the TOS.

这篇关于如果我使用youtube-API或在网络视图中展示视频,有什么优点或缺点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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