Skip to content

Commit

Permalink
Quick hack: add view intent (#4160)
Browse files Browse the repository at this point in the history
Adds VIEW intent ( copy from main / trunk ) and updates initial URL
handling accordingly.
  • Loading branch information
kaidokert authored Sep 27, 2024
1 parent 1412376 commit 4cf90a1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions starboard/android/apk/app/src/app/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@
<category android:name="android.intent.category.LEANBACK_LAUNCHER"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.media.action.MEDIA_PLAY_FROM_SEARCH"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="http"/>
<data android:scheme="https"/>
<data android:host="youtube.com"/>
<data android:host="www.youtube.com"/>
<data android:host="m.youtube.com"/>
<data android:host="youtu.be"/>
<data android:pathPattern=".*"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,13 @@ protected void onCreate(Bundle savedInstanceState) {
// STREAM_MUSIC whenever the target activity or fragment is visible.
setVolumeControlStream(AudioManager.STREAM_MUSIC);

String default_url = "https://youtube.com/tv?debugjs=1";

String startDeepLink = getIntentUrlAsString(getIntent());
Log.i(TAG, "Our starting deeplink URL is:" + startDeepLink);
if(startDeepLink == null) {
startDeepLink = default_url;
}

// super.onCreate() will cause an APP_CMD_START in native code,
// so make sure to initialize any state beforehand that might be touched by
Expand Down Expand Up @@ -116,7 +122,7 @@ public void handleOnBackPressed() {
// Create a WebView instance
webView = new ChrobaltWebView(this,getStarboardBridge());
// Load Kabuki
webView.loadUrl("https://youtube.com/tv?debugjs=1");
webView.loadUrl(startDeepLink);

// Set the WebView as the main content view of the activity
setContentView(webView);
Expand Down

0 comments on commit 4cf90a1

Please sign in to comment.