I have a html template which, when published, lists the variables of that story, and one of them is a closed caption file if captions have been made for the story:
var file_cc = "../xml/cc/example.vtt";
in the external js file I setup my player (other varaibles come from the story page):
jwplayer("vplayer").setup({
icons: false,
sources: [
{file: origurl},
{file: origurlsd}
],
image: origimg,
width: "70%",
aspectratio: "16:9",
abouttext: "...",
aboutlink: "...",
skin: "/res/libraries/jwplayer/skins/target-v6-11/glow.xml"
});
In that external js I then detect if the file_cc var exists using .get()
$.get(file_cc, function() {
console.log("found file")
})
but now, in the .done() and fail() sections of the .get() function I want to update jwplayer("vplayer)
with a tracks:
array.
How do I do that?