Closed bravao911 closed 1 year ago
@bravao911 can you give the video url and vidéo subtitle url. Is it from internal urls?. Capacitor.convertFileSrc will not work
@bravao911 can you give the video url and vidéo subtitle url. Is it from internal urls?. Capacitor.convertFileSrc will not work
subtitle url : https://shamia.net/upload/sub/[SubtitleTools.com]%20The.Deep.House.2021.720p1080p.WEBRip.x264.AAC-[YTS.MX]-Arabic.vtt
video url : https://690b1613de1830d27ee50d6b199335dd.silentsong.xyz/Movies/TheDeepHouse.mp4
l have tried
vidoPlay(url,sub,title){
let urls = url
let subtitleUrl = sub
console.log(subtitleUrl)
if (urls&&subtitleUrl) {
CapacitorVideoPlayer.initPlayer({
url:urls,
playerId:"vpPlayer",
mode:"fullscreen",
title:title,
subtitle:subtitleUrl,
subtitleOptions:{
fontSize:16
},
pipEnabled:true,
showControls:true,
displayMode:"landscape"
}).then((a)=>{
console.log(a)
CapacitorVideoPlayer.play({
playerId:'vpPlayer',
}).then((a=>{
}))
}).catch(e=>{
alert(e)
})
}
}
But l have same issue .
If l put subtitle url directly . :
vidoPlay(url,sub,title){
let urls = url
let subtitleUrl = sub
console.log(subtitleUrl)
if (urls&&subtitleUrl) {
CapacitorVideoPlayer.initPlayer({
url:urls,
playerId:"vpPlayer",
mode:"fullscreen",
title:title,
subtitle:"https://shamia.net/upload/sub/[SubtitleTools.com]%20The.Deep.House.2021.720p1080p.WEBRip.x264.AAC-[YTS.MX]-Arabic.vtt",
subtitleOptions:{
fontSize:16
},
pipEnabled:true,
showControls:true,
displayMode:"landscape"
}).then((a)=>{
console.log(a)
CapacitorVideoPlayer.play({
playerId:'vpPlayer',
}).then((a=>{
}))
}).catch(e=>{
alert(e)
})
}
}
he works fine .
l have fixed the issue by adding the language of the subtitle. Ex, my subtitle is Arabic language so l have added language:"0x0001",
As mentioned in doc
@bravao911 so i close the issue
When using a subtitle link in the
vidoPlay
function, I encounter the following error:{"method":"initPlayer","message":"cannot convert filePath in URL","result":false}
. I have checked that all the necessary data exists.Here's a short brief about the issue that you can post on GitHub:
Issue: Error when using subtitle link in
vidoPlay
functionDescription: I am facing an error when attempting to use a subtitle link in the
vidoPlay
function. The error message is as follows:{"method":"initPlayer","message":"cannot convert filePath in URL","result":false}
. I have ensured that all the required data is present.Code:
Expected Behavior: I expect the
CapacitorVideoPlayer.initPlayer
function to accept the subtitle link provided in thesubtitleUrl
variable and display the subtitles accordingly. However, the error mentioned above is encountered.Steps to Reproduce:
vidoPlay
function with a validurl
,sub
, andtitle
.subtitleUrl
variable contains a valid subtitle link.{"method":"initPlayer","message":"cannot convert filePath in URL","result":false}
.Additional Information:
CapacitorVideoPlayer
library with other functionalities, and they work as expected.Capacitor.convertFileSrc
function to convert the subtitle URL, but the error persists.Any assistance or guidance on resolving this issue would be greatly appreciated. Thank you.