remote fix with the preview

This commit is contained in:
Yuriy Liskov
2025-05-22 11:17:10 +03:00
parent e285b7e674
commit 9e6ebcc23f
2 changed files with 12 additions and 4 deletions
@@ -272,6 +272,10 @@ public class PlayerUIController extends BasePlayerController {
@Override
public void onSeekEnd() {
if (getPlayer() == null) {
return;
}
getPlayer().updateEndingTime();
}
@@ -129,7 +129,7 @@ public class RemoteController extends BasePlayerController implements OnDataChan
}
private void postStartPlaying(@Nullable Video item, boolean isPlaying) {
if (!mRemoteControlData.isDeviceLinkEnabled() || !isConnectedBefore()) {
if (isRemoteDisabled()) {
return;
}
@@ -147,7 +147,7 @@ public class RemoteController extends BasePlayerController implements OnDataChan
}
private void postStartPlaying(String videoId, long positionMs, long durationMs, boolean isPlaying) {
if (!mRemoteControlData.isDeviceLinkEnabled() || !isConnectedBefore()) {
if (isRemoteDisabled()) {
return;
}
@@ -159,7 +159,7 @@ public class RemoteController extends BasePlayerController implements OnDataChan
}
private void postState(long positionMs, long durationMs, boolean isPlaying) {
if (!mRemoteControlData.isDeviceLinkEnabled() || !isConnectedBefore()) {
if (isRemoteDisabled()) {
return;
}
@@ -171,7 +171,7 @@ public class RemoteController extends BasePlayerController implements OnDataChan
}
private void postVolumeChange(int volume) {
if (!mRemoteControlData.isDeviceLinkEnabled() || !isConnectedBefore()) {
if (isRemoteDisabled()) {
return;
}
@@ -538,4 +538,8 @@ public class RemoteController extends BasePlayerController implements OnDataChan
private boolean isConnectedBefore() {
return mConnected || mRemoteControlData.isConnectedBefore();
}
private boolean isRemoteDisabled() {
return !mRemoteControlData.isDeviceLinkEnabled() || !isConnectedBefore() || isEmbedPlayer();
}
}