always use hlsjs
This commit is contained in:
@@ -89,11 +89,7 @@ export function VideoPlayer({
|
|||||||
const [hasSubtitleTrack, setHasSubtitleTrack] = useState(false)
|
const [hasSubtitleTrack, setHasSubtitleTrack] = useState(false)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (
|
if (ref.current && Hls.isSupported()) {
|
||||||
ref.current &&
|
|
||||||
!ref.current.canPlayType('application/vnd.apple.mpegurl') &&
|
|
||||||
Hls.isSupported()
|
|
||||||
) {
|
|
||||||
hls.attachMedia(ref.current)
|
hls.attachMedia(ref.current)
|
||||||
// initial value, later on it's managed by Controls
|
// initial value, later on it's managed by Controls
|
||||||
hls.autoLevelCapping = 0
|
hls.autoLevelCapping = 0
|
||||||
@@ -112,9 +108,7 @@ export function VideoPlayer({
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (ref.current) {
|
if (ref.current) {
|
||||||
if (ref.current.canPlayType('application/vnd.apple.mpegurl')) {
|
if (Hls.isSupported()) {
|
||||||
ref.current.src = source
|
|
||||||
} else if (Hls.isSupported()) {
|
|
||||||
hls.loadSource(source)
|
hls.loadSource(source)
|
||||||
} else {
|
} else {
|
||||||
// TODO: fallback
|
// TODO: fallback
|
||||||
|
|||||||
Reference in New Issue
Block a user