When subtitle default is true it does not show
MuhammadTufailAli opened this issue · 43 comments
I am using subtitle in Oplayer.
Following is my code
.use(
[
ui({
theme: { primaryColor: "#D98420" },
coverButton: true,
pictureInPicture: false,
miniProgressBar: false,
controlBar: false, //chrome cast ko uper la k jana k lia
//subtitle are added
subtitle: {
color: "white",
fontSize: 24,
fontWeight: 700,
fontFamily: "Roboto",
background: true,
source: [
{
name: "English",
default: true,
src: MediaToPlay?.srt_file,
},
],
},
hls({ forceHLS: true }),
// chromecast,
conditionToChromeCast && otherBrowser && chromecast,
].filter(Boolean)
)
When subtitle default: true, then it does not show but if i do default: false and then enable it manually subtitle starts showing. Please help me resolve this issue
i console my Oplayer when it was created
My currentSubtitle is
{
"name": "English",
"default": true,
"src": "https://streambe1.nayatel.com/movies/Navalny.1080p-HD.srt"
}
but
isShow:false
If i reload page then isShow gets true why is this behaviour
pls upload srt file
Upload srt file where i don't understand what you said. Can you please explain?
I also added my movie link and srt link in Oplayer playground it is also not showing over there
My code
const player = Player.make("#app", {
// isLive: true,
source: {
src: "https://5c7da495a96a8.streamlock.net/vodedge/_definst_/http/movies/Navalny.1080p-HD.mp4/playlist.m3u8",
poster: "https://ohplayer.netlify.app/poster.png",
title: "君の名は"
},
autoplay: true,
videoAttr: {
// crossOrigin: "anonymous"
}
})
.use([
ui({
subtitle: {
background: true,
source: [
{
name: "Japanese",
default: true,
src: "https://streambe1.nayatel.com/movies/Navalny.1080p-HD.srt"
},
{
name: "CH & JP",
src: "https://ohplayer.netlify.app/君の名は.srt"
}
]
},
If i reload then subtitles starts showing and if i make subtitle default:false and manually open it then its start showing
source cannot access
So what should i do
i also added Oplayer playground src
{
name: "Japanese",
default: true,
src: "https://ohplayer.netlify.app/君の名は-jp.srt"
}
But it is also now showing if default: true,
Please give me solution
Yes above is working fine but in my case subtitle are not showing
Can you please use movie src as
https://5c7da495a96a8.streamlock.net/vodedge/_definst_/http/movies/Navalny.1080p-HD.mp4/playlist.m3u8
and use following subtitle
https://streambe1.nayatel.com/movies/Navalny.1080p-HD.srt
and check if subtitle show or not
In this way we will check where problem exists?
??
Unable to access your resources and subtitle files
No time this week, looking at it next week, provide your srt file
Same issue on @oplayer/ui": "1.2.34-beta.1 & Chrome 117.0.5938.149 (Official Build) (x86_64)
Same issue on @oplayer/ui": "1.2.34-beta.1 & Chrome 117.0.5938.149 (Official Build) (x86_64)
reproduction repo?
切换视频源会重建cue
重新加载是怎么个加载法?
I am using subtitle in Oplayer.
Following is my code
.use(
[
ui({
theme: { primaryColor: "#D98420" },
coverButton: true,
pictureInPicture: false,
miniProgressBar: false,
controlBar: false, //chrome cast ko uper la k jana k lia
//subtitle are added
subtitle: {
color: "white",
fontSize: 24,
fontWeight: 700,
fontFamily: "Roboto",
background: true,
source: [
{
name: "English",
default: true,
src: MediaToPlay?.srt_file,
},
],
},
hls({ forceHLS: true }),
// chromecast,
conditionToChromeCast && otherBrowser && chromecast,
].filter(Boolean)
)
When subtitle default: true, then it does not show but if i do default: false and then enable it manually subtitle starts showing. Please help me resolve this issue
我代码是放在vue的onMounted 里面的, 重新加载大概就是...关了vue这个页面,再打开.
onMounted(() => {
emit('load');
const player = Player.make('#oplayer', {
source: {
poster: webdav_thumbnail_link(props.selection.item),
title: props.selection.item.basename,
}
}).use([
ui({
controlBar: { back: "always" },
fullscreen: true,
}),
hls({
forceHLS: true,
withBitrate: true,
active(instance, lib) {
instance.on(lib.Events.MANIFEST_PARSED, (...payload) => {
console.log(payload);
});
}
}),
dash({
withBitrate: true,
active(instance, lib) {
instance.on("streamInitialized", (payload) => {
console.log(payload);
});
}
}),
mpegts(),
]).create()
fetch(...).then(() => {
player.changeSource({
src: videoUrlList[0].value,
poster: webdav_thumbnail_link(props.selection.item),
title: props.selection.item.basename,
})
player.context.ui.subtitle.changeSource(subtitleUrlList)
})
})
If i reload this page then isSHow get true and also if i do default: false and then manually turn on sutitle it works fine
MediaToPlay?.srt_file
Try this. type: 'srt'
{
name: "English",
default: true,
src: MediaToPlay?.srt_file,
type: 'srt',
},
@eritpchy i also tried to do this but still in console i get isShow:false why this wired behavior?
"@oplayer/ui": "^1.2.32",
My ui version
"@oplayer/ui": "^1.2.32", My ui version
Maybe you should upgrade to @oplayer/ui": "1.2.34-beta.1 ?
Is it working fine in 1.2.34?
Not sure..
@shiyiya ????
Are you using oplayer, may i put it in oplayer readme?
Who use OPlayer?
- NGEWIBU.TV : Nonton Anime Sub Indo | Nonton Anime Subtitle Indonesia Gratis
- Animex : Watch Anime for free in HD quality with English subbed or dubbed.
- UPV : free animes no ad
- Feel free to submit yours in Let me know!
"@oplayer/ui": "^1.2.32", My ui version
try upgrade all oplayer
npm update @oplayer/core @oplayer/ui @oplayer/xxx
Okay i hope nothing will crash after that 🤣
i updated my Oplayer all dependencies now my "@oplayer/ui": "^1.2.32", But still subtitle is not showing. Still isShow is false. Why it is still not resolved
1.2.34-beta.2
npm i @oplayer/ui@1.2.34-beta.2
close,no respond
Are you using oplayer, may i put it in oplayer readme?
Who use OPlayer?
- NGEWIBU.TV : Nonton Anime Sub Indo | Nonton Anime Subtitle Indonesia Gratis
- Animex : Watch Anime for free in HD quality with English subbed or dubbed.
- UPV : free animes no ad
- Feel free to submit yours in Let me know!
https://github.com/eritpchy/aliyundrive-webdav/releases
已经发布, 用了你的oplayer😃