home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
OnlineVideos
Subtitles, WEBVTT?
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="pilehave" data-source="post: 1155919" data-attributes="member: 71550"><p>Ok, seems that WebVTT needs to be converted to SRT, luckily you did all the hard work for me, building a converter <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite17" alt=":love:" title="Love :love:" loading="lazy" data-shortname=":love:" /></p><p></p><p>So, I converted my loadAsset function to a tuple (in order to be able to return two values from same call). In this, I added the magic subtitle download:</p><p></p><p>[code] JArray subtitleLinks = (JArray)objuri["SubtitlesList"];</p><p> string subtitleText = "";</p><p> foreach (JObject link in subtitleLinks)</p><p> {</p><p> Log.Debug("DR TV subtitle found:" + link.ToString());</p><p> string webDataUrl2 = (string)link["Uri"];</p><p> Log.Debug("DR TV subtitle uri:" + webDataUrl2);</p><p> subtitleText = Helpers.SubtitleUtils.Webvtt2SRT(GetWebData(webDataUrl2));</p><p> }[/code]</p><p></p><p>So, loadAsset is called from GetVideoUrl, the subtitle is assigned with video.SubtitleText and loadAsset returns the videolink (as it did before):</p><p></p><p>[code] Tuple<string, string> link = loadAsset(video.VideoUrl);</p><p> video.SubtitleText = link.Item2;</p><p> return link.Item1;[/code]</p><p></p><p>Seems to work really well <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite8" alt=":D" title="Big Grin :D" loading="lazy" data-shortname=":D" /></p></blockquote><p></p>
[QUOTE="pilehave, post: 1155919, member: 71550"] Ok, seems that WebVTT needs to be converted to SRT, luckily you did all the hard work for me, building a converter :love: So, I converted my loadAsset function to a tuple (in order to be able to return two values from same call). In this, I added the magic subtitle download: [code] JArray subtitleLinks = (JArray)objuri["SubtitlesList"]; string subtitleText = ""; foreach (JObject link in subtitleLinks) { Log.Debug("DR TV subtitle found:" + link.ToString()); string webDataUrl2 = (string)link["Uri"]; Log.Debug("DR TV subtitle uri:" + webDataUrl2); subtitleText = Helpers.SubtitleUtils.Webvtt2SRT(GetWebData(webDataUrl2)); }[/code] So, loadAsset is called from GetVideoUrl, the subtitle is assigned with video.SubtitleText and loadAsset returns the videolink (as it did before): [code] Tuple<string, string> link = loadAsset(video.VideoUrl); video.SubtitleText = link.Item2; return link.Item1;[/code] Seems to work really well :D [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
MediaPortal 1 Plugins
Popular Plugins
OnlineVideos
Subtitles, WEBVTT?
Contact us
RSS
Top
Bottom