mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-06 03:50:04 +02:00
Fix ads error
https://github.com/DanielnetoDotCom/YouPHPTube/issues/391#issuecomment-369294878 And Fix subtile and resolutions issue on it
This commit is contained in:
parent
901da951e1
commit
8a62a459b9
3 changed files with 33 additions and 5 deletions
|
@ -27,7 +27,6 @@ function clean_name(str) {
|
|||
str = str.stripAccents().toLowerCase();
|
||||
return str.replace(/\W+/g, "-");
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
modal = modal || (function () {
|
||||
var pleaseWaitDiv = $("#pleaseWaitDialog");
|
||||
|
@ -115,10 +114,30 @@ $(document).ready(function () {
|
|||
}
|
||||
});
|
||||
});
|
||||
|
||||
function removeTracks(){
|
||||
var oldTracks = player.remoteTextTracks();
|
||||
var i = oldTracks.length;
|
||||
while (i--) {
|
||||
player.removeRemoteTextTrack(oldTracks[i]);
|
||||
}
|
||||
}
|
||||
|
||||
function changeVideoSrc(vid_obj, source) {
|
||||
vid_obj.src(source);
|
||||
var srcs = [];
|
||||
var traks = [];
|
||||
removeTracks();
|
||||
for(i=0;i<source.length;i++){
|
||||
if(source[i].type){
|
||||
srcs.push(source[i]);
|
||||
}else if(source[i].srclang){
|
||||
player.addRemoteTextTrack(source[i]);
|
||||
}
|
||||
}
|
||||
player.updateSrc(srcs);
|
||||
vid_obj.load();
|
||||
vid_obj.play();
|
||||
player.play();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue