Commit 86a95c2a by tonihei Committed by Rohit Singh

Correctly map deprecated methods in MediaController to replacement

This avoids throwing exceptions for correct (but deprecated) Player
method invocations.

PiperOrigin-RevId: 502341428
parent 3c476e2d
......@@ -479,7 +479,10 @@ public class MediaController implements Player {
@Deprecated
@Override
public void stop(boolean reset) {
throw new UnsupportedOperationException();
stop();
if (reset) {
clearMediaItems();
}
}
/**
......@@ -1175,7 +1178,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public boolean isCurrentWindowDynamic() {
throw new UnsupportedOperationException();
return isCurrentMediaItemDynamic();
}
@Override
......@@ -1192,7 +1195,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public boolean isCurrentWindowLive() {
throw new UnsupportedOperationException();
return isCurrentMediaItemLive();
}
@Override
......@@ -1209,7 +1212,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public boolean isCurrentWindowSeekable() {
throw new UnsupportedOperationException();
return isCurrentMediaItemSeekable();
}
@Override
......@@ -1261,7 +1264,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public int getCurrentWindowIndex() {
throw new UnsupportedOperationException();
return getCurrentMediaItemIndex();
}
@Override
......@@ -1277,7 +1280,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public int getPreviousWindowIndex() {
throw new UnsupportedOperationException();
return getPreviousMediaItemIndex();
}
/**
......@@ -1300,7 +1303,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public int getNextWindowIndex() {
throw new UnsupportedOperationException();
return getNextMediaItemIndex();
}
/**
......@@ -1323,7 +1326,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public boolean hasPrevious() {
throw new UnsupportedOperationException();
return hasPreviousMediaItem();
}
/**
......@@ -1333,7 +1336,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public boolean hasNext() {
throw new UnsupportedOperationException();
return hasNextMediaItem();
}
/**
......@@ -1343,7 +1346,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public boolean hasPreviousWindow() {
throw new UnsupportedOperationException();
return hasPreviousMediaItem();
}
/**
......@@ -1353,7 +1356,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public boolean hasNextWindow() {
throw new UnsupportedOperationException();
return hasNextMediaItem();
}
@Override
......@@ -1375,7 +1378,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public void previous() {
throw new UnsupportedOperationException();
seekToPreviousMediaItem();
}
/**
......@@ -1385,7 +1388,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public void next() {
throw new UnsupportedOperationException();
seekToNextMediaItem();
}
/**
......@@ -1395,7 +1398,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public void seekToPreviousWindow() {
throw new UnsupportedOperationException();
seekToPreviousMediaItem();
}
/**
......@@ -1421,7 +1424,7 @@ public class MediaController implements Player {
@Deprecated
@Override
public void seekToNextWindow() {
throw new UnsupportedOperationException();
seekToNextMediaItem();
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment