【发布时间】:2018-04-11 05:39:57
【问题描述】:
如何在 Android Studio 中设计的应用中使用 YouTube API 从简单的嵌入式视频中删除 YouTube 徽标?
清单文件:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.user.myyoutubeapp">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Next"></activity>
</application>
</manifest>`
XML 代码:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<view
android:id="@+id/view"
class="com.google.android.youtube.player.YouTubePlayerView"
id="@+id/myyoutubeapp"
layout_marginTop="16dp"
android:layout_width="match_parent"
android:layout_height="380dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"/>
<Button
android:id="@+id/button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:text="Play"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/view" />
</android.support.constraint.ConstraintLayout>
I need to hide the marked logo from the embedded video
为了从上面设计的应用程序中删除 YouTube 徽标,可以进行哪些必要的更改。
【问题讨论】:
-
使用嵌入链接,您可以使用“modestbranding”标志来隐藏 youtube 徽标。不确定这如何适用于 Android。例如:youtube.com/embed/video-link?modestbranding=1
-
如何使用嵌入链接,因为在java代码文件中,只需要在youTubePlayer.loadVideo()命令中输入附加字符串值..!! @AnuraagBaishya
标签: android android-studio youtube