我正在尝试使用此处找到的 Vimeo Srt Jquery 插件为 vimeo 视频添加字幕
https://github.com/Yomguithereal/vimeo-srt
我可以使用模板让字幕正常播放,但我想要一个下拉选择来根据需要选择和更改您的字幕。我有下面的代码,但看起来一旦字幕初始化它就不会改变。有人有什么建议吗?
<div id="container">
<iframe id="vimeoplayer" video="68038551" width="690px" height="422px" frameborder="0" webkitallowfullscreen="" mozallowfullscreen="" allowfullscreen="" src="http://player.vimeo.com/video/68038551?api=1&player_id=vimeoplayer" scrolling="no"> </iframe>
</div>
<script src="http://code.jquery.com/jquery-2.0.0.min.js"></script>
<script src="http://a.vimeocdn.com/js/froogaloop2.min.js"></script>
<script src="jquery.vimeo-srt.js"></script>
<form class="pure-form pure-form-stacked">
<select name="subs" id="subs">
<option selected="selected" value="0">Subtitles</option>
<option value="EN">English</option>
<option value="RU">Russian</option>
<option value="TL">Tagalog</option>
<option value="ZH">Chinese</option>
</select>
</form>
<script type="text/javascript">
$(document).ready(function(){
var $player =$("#vimeoplayer");
$player.vimeoSrt({srt : 'vgroup_env_comp.EN.srt'});
$( "#subs").change(function () {
if ($("#subs").val() == "0") {
$player.vimeoSrt({srt :''});
} else {
var pathtofile= "mysubtitles." + $( "#subs" ).val() + ".srt";
$player.vimeoSrt({srt : pathtofile});
}
});
});
</script>