Fix android build
Some checks failed
Build Android / Build Android Example App (pull_request) Has been cancelled
Build Android / Build Android Example App Without Ads (pull_request) Has been cancelled
Check Android / Kotlin-Lint (pull_request) Has been cancelled

This commit is contained in:
Ivan Malison 2024-10-13 22:48:51 -06:00 committed by Volodymyr Smolianinov
parent 56c129aa4f
commit 47151c7119
2 changed files with 17 additions and 6 deletions

View File

@ -533,12 +533,21 @@ public class ReactExoplayerView extends FrameLayout implements
builder.setSingleChoiceItems(speedOptions, selectedSpeedIndex, (dialog, which) -> { builder.setSingleChoiceItems(speedOptions, selectedSpeedIndex, (dialog, which) -> {
selectedSpeedIndex = which; selectedSpeedIndex = which;
float speed = switch (which) { float speed;
case 0 -> 0.5f; switch (which) {
case 2 -> 1.5f; case 0:
case 3 -> 2.0f; speed = 0.5f;
default -> 1.0f; break;
}; case 1:
speed = 1.0f;
break;
case 2:
speed = 1.5f;
break;
default:
speed = 1.0f;
break;
}
setRateModifier(speed); setRateModifier(speed);
}); });
builder.show(); builder.show();

View File

@ -6,6 +6,7 @@ import React, {
useRef, useRef,
type RefObject, type RefObject,
} from 'react'; } from 'react';
//@ts-ignore
import shaka from 'shaka-player'; import shaka from 'shaka-player';
import type {VideoRef, ReactVideoProps, VideoMetadata} from './types'; import type {VideoRef, ReactVideoProps, VideoMetadata} from './types';
@ -236,6 +237,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
shakaPlayerRef.current.unload() shakaPlayerRef.current.unload()
} }
shakaPlayerRef.current = new shaka.Player(); shakaPlayerRef.current = new shaka.Player();
//@ts-ignore
shakaPlayerRef.current.addEventListener("error", (event) => { shakaPlayerRef.current.addEventListener("error", (event) => {
//@ts-ignore //@ts-ignore
const shakaError = event.detail; const shakaError = event.detail;