Setting the src attribute on a HTMLTrackElement trigger a text track change
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
People
(Reporter: luo423, Unassigned)
References
Details
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36
Steps to reproduce:
1、 Get "track" Element.
2、 change it‘s src.
Actual results:
The WebVtt Subtitles will stop and it doesn't change into a new Subtitles,it just stop there,it happen in all version .But it works on chrome.
Expected results:
I want to change the Subtitles by changing <track/>'s src.
(In reply to Matthias Versen [:Matti] from comment #1)
Please provide a testcase
Purpose: I want to change the Subtitles by changing <track/>'s src.
It works on Chrome.
HTML:
<video src="./test.mp4" controls>
<track kind="subtitles" src="./1.vtt" srclang="zh" label="Chinese" default>
</video>
JS:
button1.onclick = function () {
document.getElementsByTagName('track')[0].src = './1.vtt';
}
button2.onclick = function () {
document.getElementsByTagName('track')[0].src = './2.vtt';
}
button3.onclick = function () {
//Close the subtitles;
document.getElementsByTagName('track')[0].src = '';
}
Updated•7 years ago
|
Comment 3•7 years ago
|
||
This test case is widely incomplete, please make sure to attach something that works next time. In particular, some buttons are missing from the HTML, and the text track is not present.
To do what you want to do, you need to have multiple <track>
elements and have the one you want to show have mode="showing"
as attribute, and the others mode="hidden"
. You can also have all of them "hidden" if you want to not display any subtitles.
The bug is valid though, we don't pass 0.
Updated•3 years ago
|
Description
•