Replies: 4 comments 10 replies
-
Please provide a minimal repository on GitHub. |
Beta Was this translation helpful? Give feedback.
1 reply
-
source type is Source |
Beta Was this translation helpful? Give feedback.
1 reply
-
'use client'
import ReactOPlayer from '@oplayer/react'
import ui from '@oplayer/ui'
import Player, { Source } from '@oplayer/core'
import hls from '@oplayer/hls'
import { useEffect, useState, useRef } from 'react'
const plugins = [
ui({
theme: {
controller: {
slideToSeek: 'always'
}
},
pictureInPicture: false,
screenshot: false,
keyboard: { global: true }
}),
hls()
]
export default function Home() {
const [source, setSource] = useState<Promise<Source>>()
const player = useRef<Player>(null)
useEffect(() => {
setSource(
fetch('111').then(() => ({
src: 'https://streamweb.qdei.co:8443/ae96f3d3-e229-4b29-b9f3-68973140b935/master.m3u8'
}))
)
}, [])
return (
<>
<ReactOPlayer plugins={plugins} ref={player} autoplay={false} source={source} />
</>
)
} |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
shiyiya
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Dev,
I try it developing in Next.js App, but i got issue about in when import module
@oplayer/ui
.Can you explain, or give some examples. By the way, i interested for your player, maybe will build web/mobile app using this Player, since the UI and look fresh and modern XD.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions