Skip to content

Commit

Permalink
Wrap one more case of video playback speed in try-catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Rian8337 committed Mar 4, 2025
1 parent 33987f0 commit 4e52632
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions res/values/strings_temporary_for_locals.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
<string name="opt_snakingOutSliders_title">Use snaking out sliders</string>
<string name="opt_snakingOutSliders_summary">Enable sliders gradually snaking disappearing from one node</string>

<string name="message_video_custom_speed_unsupported">Custom video playback speed is not supported in this device</string>

<!-- HUD editor -->

<string name="opt_hudEditor_title">HUD Editor</string>
Expand Down
9 changes: 8 additions & 1 deletion src/ru/nsu/ccfit/zuev/osu/game/GameScene.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
import ru.nsu.ccfit.zuev.osu.scoring.StatisticV2;
import ru.nsu.ccfit.zuev.osu.scoring.TouchType;
import ru.nsu.ccfit.zuev.osuplus.BuildConfig;
import ru.nsu.ccfit.zuev.osuplus.R;
import ru.nsu.ccfit.zuev.skins.OsuSkin;
import ru.nsu.ccfit.zuev.skins.BeatmapSkinManager;

Expand Down Expand Up @@ -1305,7 +1306,13 @@ public void onUpdate(final float pSecondsElapsed) {
{
if (!videoStarted) {
video.play();
video.setPlaybackSpeed(GameHelper.getSpeedMultiplier());
// Some devices do not support custom playback speed for whatever reason.
try {
video.setPlaybackSpeed(GameHelper.getSpeedMultiplier());
} catch (Exception e) {
Log.e("GameScene", "Failed to change video playback speed.", e);
ToastLogger.showText(R.string.message_video_custom_speed_unsupported, false);
}
videoStarted = true;
}

Expand Down

0 comments on commit 4e52632

Please sign in to comment.