Closed dev-AshishRanjan closed 1 month ago
We can render subtitles as HTML in ArtPlayer by modifying the subtitle rendering logic to support dangerouslySetInnerHTML. Simply by adding a setSubtitlesDangerously flag to toggle between safe text and HTML rendering for flexibility.
Or you can try the escape
:
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
subtitle: {
url: '/assets/sample/subtitle.srt',
escape: false,
},
});
Just wanted to ask and suggest about Subtitle rendering in ArtPlayer
I am getting html tags in my subtitles(subtitles are from opensubtitles), subtitles are in
srt
format When subtitles are rendered, they are being treated as simple text, but can be treated as html. Is there any way to render them as html? My code implementation for subtitlesscreenshot
Link to issue
Rive choose any subtitles in OpenSubtiles from players settings
Proposed Solution:
In react
Rendered as text
Rendered as HTML
If you want to keep the current rendering process, then You can add this as a new option to Artplayer.