Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions advertising-optiview-ads/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Base">
Expand All @@ -13,6 +21,7 @@
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<meta-data
Expand Down
9 changes: 9 additions & 0 deletions background-playback/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
<!-- Needed to start the foreground service -->
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Base">
Expand All @@ -20,6 +28,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>

Expand Down
9 changes: 9 additions & 0 deletions basic-playback/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Base">
Expand All @@ -13,6 +21,7 @@
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<meta-data
Expand Down
65 changes: 65 additions & 0 deletions common/src/main/res/drawable/tv_banner.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:width="320dp"
android:height="180dp"
android:viewportWidth="320"
android:viewportHeight="180"
tools:ignore="VectorRaster">
<!-- Black background -->
<path
android:pathData="M0,0h320v180H0z"
android:fillColor="#000000"/>
<!-- Dolby OptiView logo, centered -->
<group
android:translateX="71.50"
android:translateY="56.73"
android:scaleX="0.49"
android:scaleY="0.49">
<path
android:pathData="M248.45,0.01h10.91v72.03h-10.91Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M216.46,22.16c-13.75,0-24.93,11.18-24.93,24.93s11.18,24.93,24.93,24.93,24.93-11.18,24.93-24.93-11.18-24.93-24.93-24.93ZM216.46,62.04c-8.34,0-15.03-6.78-15.03-15.03s6.78-15.03,15.03-15.03,15.03,6.78,15.03,15.03-6.78,15.03-15.03,15.03Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M102.23,71.96h-10.6c-19.79,0-35.93-16.14-35.93-35.93S71.83.1,91.63.1h10.6v71.86Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M0,0h10.6C30.4,0,46.53,16.14,46.53,35.94s-16.14,35.93-35.93,35.93H0V0Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M293.71,22.17c-5.3,0-10.21,1.67-14.26,4.5V.01h-10.93v72.03h10.93v-4.51c4.04,2.83,8.96,4.5,14.26,4.5,13.75,0,24.93-11.18,24.93-24.93s-11.18-24.93-24.93-24.93ZM293.71,62.04c-6.67,0-12.27-4.34-14.26-10.3-.5-1.49-.78-3.08-.78-4.74s.28-3.25.78-4.75c2-5.99,7.65-10.29,14.26-10.29,8.25,0,15.03,6.78,15.03,15.03s-6.78,15.03-15.03,15.03Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M150.01,0h-25.99v71.96h25.99c19.84,0,35.98-16.14,35.98-35.98S169.85,0,150.01,0ZM150.01,61.05h-15.08V10.91h15.08c13.81,0,25.07,11.26,25.07,25.07s-11.26,25.07-25.07,25.07Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M358.61,22.18l-14.21,31.95-14.21-31.95h-11.92l20.17,45.33-.4.88-.15.31-4.36,9.86s-.02.05-.03.08c-1.31,2.93-4.76,4.26-7.68,2.95l-1.57-.7-3.05,6.85-1.35,3.04h0s0,0,0,0h.02s3.78,1.69,3.78,1.69c7.09,3.16,15.46-.05,18.63-7.16.03-.06,25.83-57.72,28.25-63.13h-11.92Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M107.58,121.06c0,2.53-.44,4.85-1.32,6.97-.88,2.12-2.09,3.94-3.64,5.46-1.54,1.53-3.38,2.72-5.51,3.57-2.13.85-4.45,1.27-6.95,1.27s-4.81-.42-6.92-1.27c-2.11-.85-3.94-2.04-5.49-3.57-1.54-1.53-2.75-3.35-3.61-5.46-.86-2.11-1.3-4.44-1.3-6.97s.43-4.9,1.3-7.02c.86-2.11,2.07-3.92,3.61-5.42,1.54-1.5,3.37-2.66,5.49-3.5,2.11-.83,4.42-1.25,6.92-1.25s4.82.42,6.95,1.25c2.13.83,3.97,2,5.51,3.5,1.54,1.5,2.76,3.3,3.64,5.42.88,2.12,1.32,4.45,1.32,7.02ZM102.62,121.06c0-1.79-.29-3.48-.88-5.07s-1.42-2.99-2.5-4.19c-1.08-1.2-2.38-2.15-3.91-2.85-1.53-.69-3.25-1.04-5.16-1.04s-3.59.35-5.12,1.04c-1.53.7-2.82,1.64-3.89,2.85-1.07,1.2-1.89,2.6-2.48,4.19-.59,1.59-.88,3.28-.88,5.07s.29,3.54.88,5.14c.59,1.61,1.42,3,2.5,4.19,1.08,1.19,2.38,2.12,3.89,2.8,1.51.68,3.21,1.02,5.09,1.02s3.6-.34,5.14-1.02c1.54-.68,2.86-1.61,3.94-2.8,1.08-1.19,1.91-2.58,2.5-4.19.59-1.6.88-3.32.88-5.14Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M122.25,148.61h-4.35v-33.06h4.26v3.43h.14c.71-1.17,1.75-2.14,3.13-2.89,1.37-.76,2.97-1.13,4.79-1.13,1.64,0,3.13.29,4.47.88,1.34.59,2.5,1.41,3.47,2.45.97,1.05,1.72,2.28,2.25,3.68.52,1.4.79,2.91.79,4.51s-.26,3.12-.79,4.54c-.53,1.42-1.27,2.66-2.22,3.7-.96,1.05-2.11,1.88-3.47,2.48-1.36.6-2.89.9-4.58.9-1.57,0-3.06-.34-4.45-1.02s-2.49-1.64-3.29-2.87h-.14v14.4ZM136.69,126.48c0-1.02-.15-2.01-.46-2.96-.31-.96-.77-1.81-1.39-2.55-.62-.74-1.38-1.33-2.29-1.76-.91-.43-1.97-.65-3.17-.65-1.11,0-2.12.22-3.03.65-.91.43-1.69,1.02-2.34,1.76-.65.74-1.15,1.59-1.5,2.55-.36.96-.53,1.96-.53,3.01s.18,2.05.53,3.01c.35.96.86,1.8,1.5,2.52.65.73,1.43,1.3,2.34,1.74.91.43,1.92.65,3.03.65,1.2,0,2.26-.22,3.17-.67.91-.45,1.67-1.04,2.29-1.78.62-.74,1.08-1.59,1.39-2.55.31-.96.46-1.94.46-2.96Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M162.26,119.12h-5.83v11.44c0,1.33.25,2.28.74,2.85.49.57,1.28.86,2.36.86.4,0,.83-.05,1.3-.14.46-.09.88-.23,1.25-.42l.14,3.57c-.52.19-1.1.33-1.74.44-.63.11-1.29.16-1.97.16-2.07,0-3.65-.57-4.75-1.71-1.1-1.14-1.64-2.86-1.64-5.14v-11.9h-4.21v-3.57h4.21v-6.3h4.31v6.3h5.83v3.57Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M176.01,107.63c0,.8-.29,1.47-.86,1.99-.57.53-1.26.79-2.06.79s-1.48-.27-2.04-.81c-.56-.54-.83-1.2-.83-1.97s.28-1.47.83-2.01c.56-.54,1.23-.81,2.04-.81s1.49.27,2.06.81c.57.54.86,1.21.86,2.01ZM175.27,137.5h-4.35v-21.95h4.35v21.95Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M198.61,131.57h.14l9.86-26.86h4.95l-12.87,32.78h-4.26l-12.78-32.78h5.09l9.86,26.86Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M227.01,107.63c0,.8-.29,1.47-.86,1.99-.57.53-1.26.79-2.06.79s-1.48-.27-2.04-.81c-.56-.54-.83-1.2-.83-1.97s.28-1.47.83-2.01c.56-.54,1.23-.81,2.04-.81s1.49.27,2.06.81c.57.54.86,1.21.86,2.01ZM226.27,137.5h-4.35v-21.95h4.35v21.95Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M258.17,126.34v.74c0,.25-.02.49-.05.74h-17.41c.03.93.24,1.8.62,2.62.39.82.9,1.53,1.55,2.13s1.4,1.07,2.25,1.41c.85.34,1.75.51,2.71.51,1.48,0,2.76-.32,3.84-.97,1.08-.65,1.93-1.44,2.55-2.36l3.06,2.45c-1.17,1.54-2.55,2.68-4.14,3.4s-3.36,1.09-5.3,1.09c-1.67,0-3.21-.28-4.63-.83-1.42-.56-2.64-1.33-3.66-2.34-1.02-1-1.82-2.21-2.41-3.63-.59-1.42-.88-2.99-.88-4.72s.29-3.26.86-4.7c.57-1.44,1.37-2.66,2.38-3.68s2.22-1.81,3.61-2.38c1.39-.57,2.89-.86,4.49-.86s3.06.26,4.38.79c1.31.53,2.42,1.28,3.33,2.27.91.99,1.61,2.18,2.11,3.59.49,1.41.74,2.99.74,4.75ZM253.77,124.58c-.03-.86-.18-1.67-.44-2.43-.26-.76-.65-1.41-1.16-1.97-.51-.56-1.14-1-1.9-1.32-.76-.32-1.64-.49-2.66-.49-.93,0-1.8.16-2.62.49-.82.32-1.53.76-2.13,1.32-.6.56-1.1,1.21-1.48,1.97-.39.76-.61,1.57-.67,2.43h13.06Z"
android:fillColor="#FFFFFF"/>
<path
android:pathData="M269.57,115.55l4.96,16.76h.09l5.23-16.76h4.58l5.33,16.76h.09l4.96-16.76h4.58l-7.27,21.95h-4.54l-5.42-16.49h-.09l-5.37,16.49h-4.54l-7.32-21.95h4.72Z"
android:fillColor="#FFFFFF"/>
</group>
</vector>

9 changes: 9 additions & 0 deletions custom-surface-rendering/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@

<uses-permission android:name="android.permission.INTERNET" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Base" >
Expand All @@ -15,6 +23,7 @@
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>

Expand Down
9 changes: 9 additions & 0 deletions drm-playback/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@

<uses-permission android:name="android.permission.INTERNET" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Base">
Expand All @@ -14,6 +22,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>

Expand Down
9 changes: 9 additions & 0 deletions full-screen-handling/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@

<uses-permission android:name="android.permission.INTERNET" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Base">
Expand All @@ -16,6 +24,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>

</activity>
Expand Down
9 changes: 9 additions & 0 deletions google-cast/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WAKE_LOCK" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Cast">
Expand All @@ -27,6 +35,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>

</activity>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.theoplayer.sample.playback.cast

import android.content.Context
import android.os.Bundle
import android.util.Log
import androidx.activity.compose.setContent
Expand All @@ -15,6 +16,8 @@ import androidx.fragment.app.FragmentActivity
import androidx.mediarouter.app.MediaRouteButton
import com.google.android.gms.cast.framework.CastButtonFactory
import com.google.android.gms.cast.framework.CastContext
import com.google.android.gms.common.ConnectionResult
import com.google.android.gms.common.GoogleApiAvailability
import com.theoplayer.android.api.THEOplayerConfig
import com.theoplayer.android.api.THEOplayerGlobal
import com.theoplayer.android.api.THEOplayerView
Expand All @@ -36,8 +39,25 @@ class PlayerActivity : FragmentActivity() {

override fun onCreate(savedInstanceState: Bundle?) {

// Check if Cast API is available on the device (Google Play Services is available, CastContext can be initialized, and device is not an Android TV).
fun isCastAvailable(context: Context): Boolean {
when (GoogleApiAvailability.getInstance().isGooglePlayServicesAvailable(context)) {
ConnectionResult.SUCCESS -> {
try {
CastContext.getSharedInstance(context)
return true
} catch (_: Exception) {
return false
}
}
else -> return false
}
}

// Initialize Chromecast immediately, for automatic receiver discovery to work correctly.
CastContext.getSharedInstance(this)
if (isCastAvailable(applicationContext)) {
CastContext.getSharedInstance(this)
}

// Enable all debug logs from THEOplayer.
THEOplayerGlobal.getSharedInstance(this).logger.enableAllTags()
Expand Down Expand Up @@ -185,7 +205,9 @@ class PlayerActivity : FragmentActivity() {
// CastButtonFactory.setUpMediaRouteButton() method.
factory = { _ ->
MediaRouteButton(context).apply {
CastButtonFactory.setUpMediaRouteButton(context, this)
if (isCastAvailable(applicationContext)) {
CastButtonFactory.setUpMediaRouteButton(context, this)
}
}
}
)
Expand Down
9 changes: 9 additions & 0 deletions google-dai/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@

<uses-permission android:name="android.permission.INTERNET" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Base">
Expand All @@ -16,6 +24,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>

</activity>
Expand Down
9 changes: 9 additions & 0 deletions google-ima/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@

<uses-permission android:name="android.permission.INTERNET" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:theme="@style/DolbyTheme.Base">
Expand All @@ -16,6 +24,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>

</activity>
Expand Down
9 changes: 9 additions & 0 deletions localization/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:localeConfig="@xml/locales_config"
Expand All @@ -14,6 +22,7 @@
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>
</activity>
<meta-data
Expand Down
9 changes: 9 additions & 0 deletions metadata-handling/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,15 @@

<uses-permission android:name="android.permission.INTERNET" />

<uses-feature
android:name="android.software.leanback"
android:required="false" />
<uses-feature
android:name="android.hardware.touchscreen"
android:required="false" />

<application
android:banner="@drawable/tv_banner"
android:icon="@mipmap/ic_launcher"
android:label="@string/appDisplayName"
android:roundIcon="@mipmap/ic_launcher_round"
Expand All @@ -18,6 +26,7 @@
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
</intent-filter>

</activity>
Expand Down
Loading