Skip to content

Commit

Permalink
MediaLoadOptions deprecation and CAF SDK upgrade
Browse files Browse the repository at this point in the history
Change-Id: Id930e33a7b0e1b0aade18e4c88722eec60606486
  • Loading branch information
meihua committed Jul 2, 2019
1 parent b5a87a1 commit e88b44e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void testProgressBarControl() throws UiObjectNotFoundException, Interrupt
mTestUtils.playCastContent(VIDEO_WITHOUT_SUBTITLES);
mTestUtils.assertPlayerState(MediaStatus.PLAYER_STATE_PLAYING, MAX_TIMEOUT_MS);

UiObject2 progressBar = mDevice.findObject(By.res(resources.getResourceName(R.id.seek_bar)));
UiObject2 progressBar = mDevice.findObject(By.res(resources.getResourceName(R.id.cast_seek_bar)));
progressBar.scroll(Direction.LEFT, 0.75f, 500);
mTestUtils.assertStreamPosition(0.75f);

Expand Down
4 changes: 2 additions & 2 deletions androidTest/com/google/sample/cast/refplayer/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ public void run() {
* Check the Expanded Controller UI
*/
void verifyExpandedController() {
onView(withId(R.id.expanded_controller_layout))
onView(withId(R.id.controllers))
.check(matches(isDisplayed()));
onView(withId(R.id.seek_bar))
onView(withId(R.id.cast_seek_bar))
.check(matches(isDisplayed()));
onView(withId(R.id.start_text))
.check(matches(isDisplayed()));
Expand Down
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ dependencies {
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.mediarouter:mediarouter:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.gms:play-services-cast-framework:16.1.2'
implementation 'com.google.android.gms:play-services-cast-framework:17.0.0'
implementation 'com.android.volley:volley:1.1.1'

androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test:rules:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0'
testImplementation 'junit:junit:4.12'
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.NetworkImageView;
import com.google.android.gms.cast.MediaInfo;
import com.google.android.gms.cast.MediaLoadOptions;
import com.google.android.gms.cast.MediaLoadRequestData;
import com.google.android.gms.cast.MediaMetadata;
import com.google.android.gms.cast.framework.CastButtonFactory;
import com.google.android.gms.cast.framework.CastContext;
Expand Down Expand Up @@ -344,10 +344,10 @@ public void onStatusUpdated() {
remoteMediaClient.unregisterCallback(this);
}
});
remoteMediaClient.load(mSelectedMedia,
new MediaLoadOptions.Builder()
.setAutoplay(autoPlay)
.setPlayPosition(position).build());
remoteMediaClient.load(new MediaLoadRequestData.Builder()
.setMediaInfo(mSelectedMedia)
.setAutoplay(autoPlay)
.setCurrentTime(position).build());
}

private void setCoverArtStatus(String url) {
Expand Down

0 comments on commit e88b44e

Please sign in to comment.