Skip to content

Commit

Permalink
Removed IMA SDK for Cast v2 integration. Publishers integrating cast …
Browse files Browse the repository at this point in the history
…support into their apps are recommended to now use CAF native Ad Breaks.

PiperOrigin-RevId: 411061206
  • Loading branch information
google-ima-devrel-bot authored and IMA Developer Relations committed Nov 19, 2021
1 parent 5d01304 commit 147478c
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 274 deletions.
1 change: 0 additions & 1 deletion AdvancedExample/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,5 @@ dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.mediarouter:mediarouter:1.2.5'
implementation 'com.google.android.gms:play-services-cast-framework:20.0.0'
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
}
3 changes: 0 additions & 3 deletions AdvancedExample/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
android:label="@string/app_name"
android:theme="@style/AppTheme"
android:networkSecurityConfig="@xml/network_security_config">
<meta-data
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME"
android:value="com.google.ads.interactivemedia.v3.samples.videoplayerapp.CastOptionsProvider" />
<activity
android:name=".MyActivity"
android:label="@string/app_name"
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.google.ads.interactivemedia.v3.samples.videoplayerapp;

import android.app.UiModeManager;
import android.content.res.Configuration;
import android.os.Build;
import android.os.Bundle;
Expand All @@ -11,7 +10,6 @@
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import com.google.android.gms.cast.framework.CastButtonFactory;

/** Main Activity. */
public class MyActivity extends AppCompatActivity
Expand All @@ -22,8 +20,6 @@ public class MyActivity extends AppCompatActivity
private static final String VIDEO_PLAYLIST_FRAGMENT_TAG = "video_playlist_fragment_tag";
private static final String VIDEO_EXAMPLE_FRAGMENT_TAG = "video_example_fragment_tag";

private CastApplication castApplication;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand All @@ -40,28 +36,17 @@ protected void onCreate(Bundle savedInstanceState) {
.commit();
}

UiModeManager uiModeManager = (UiModeManager) getSystemService(UI_MODE_SERVICE);
if (uiModeManager.getCurrentModeType() != Configuration.UI_MODE_TYPE_TELEVISION) {
// Only create a cast application on devices that support cast.
castApplication = new CastApplication(this);
}
orientAppUi();
}

@Override
protected void onResume() {
super.onResume();
if (castApplication != null) {
castApplication.onResume();
}
}

@Override
protected void onPause() {
super.onPause();
if (castApplication != null) {
castApplication.onPause();
}
}

@Override
Expand All @@ -71,8 +56,6 @@ public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(R.menu.my, menu);

CastButtonFactory.setUpMediaRouteButton(
getApplicationContext(), menu, R.id.media_route_menu_item);
return true;
}

Expand All @@ -99,11 +82,6 @@ private void orientAppUi() {
VideoFragment videoFragment =
(VideoFragment) fragmentManager.findFragmentByTag(VIDEO_EXAMPLE_FRAGMENT_TAG);

if (castApplication != null) {
// When videoFragment is null, this lets the castApplication release its reference to the
// fragment.
castApplication.setVideoFragment(videoFragment);
}
Fragment videoListFragment = fragmentManager.findFragmentByTag(VIDEO_PLAYLIST_FRAGMENT_TAG);

if (videoFragment != null) {
Expand Down Expand Up @@ -155,10 +133,6 @@ public void onVideoSelected(VideoItem videoItem) {
}
videoFragment.loadVideo(videoItem);

if (castApplication != null) {
castApplication.setVideoFragment(videoFragment);
}

invalidateOptionsMenu();
orientAppUi();
}
Expand Down

0 comments on commit 147478c

Please sign in to comment.