From f377531dc002b201f5b0ccd69450fa32aa28085c Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 19 May 2021 00:51:47 +0200 Subject: [PATCH] add custom session --- app/app/build.gradle | 4 ++-- app/app/src/main/java/it/purser/stream/ShareActivity.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/app/build.gradle b/app/app/build.gradle index 33479d4..b1c70a7 100644 --- a/app/app/build.gradle +++ b/app/app/build.gradle @@ -10,8 +10,8 @@ android { applicationId "it.purser.stream" minSdkVersion 25 targetSdkVersion 29 - versionCode 1 - versionName "1.0" + versionCode 102 + versionName "102.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/app/src/main/java/it/purser/stream/ShareActivity.java b/app/app/src/main/java/it/purser/stream/ShareActivity.java index 0fc66ac..f7d59b1 100644 --- a/app/app/src/main/java/it/purser/stream/ShareActivity.java +++ b/app/app/src/main/java/it/purser/stream/ShareActivity.java @@ -9,7 +9,7 @@ import java.util.Locale; public class ShareActivity extends Activity { private Uri getSharedLink() { - HashSet domains = new HashSet(); + HashSet domains = new HashSet<>(); domains.add("youtu.be"); Intent intent = getIntent(); @@ -38,7 +38,11 @@ public class ShareActivity extends Activity { builder.path(uri.getPath()); builder.appendQueryParameter("provider", "youtube"); builder.appendQueryParameter("render", "true"); + builder.appendQueryParameter("cast", "true"); Intent launch = new Intent(Intent.ACTION_VIEW, builder.build()); + launch.setPackage("com.android.chrome"); + launch.putExtra("android.support.customtabs.extra.SESSION", "Proxy Stream"); + launch.putExtra("android.support.customtabs.extra.TOOLBAR_COLOR", 0xff0000); startActivity(launch); } }