Reputation: 1980
I want to call a video in ajax query, it work but not corectly (It lacks the control buttons of the video player)
Here is my ajax code:
$.ajax({
context: document.body,
url: "/?get=json&act=video",
type: "get",
success: function(html) {
// console.log(JSON.parse(html));
var a = JSON.parse(html);
var returnVideo = "";
a.forEach(function(element) {
console.log(element);
returnVideo += ' <div class="uk-card uk-card-hover uk-card-default">';
returnVideo += ' <div class="uk-card-media-top">';
returnVideo += ' <video width="" height="">';
returnVideo += ' <source src="'+element.gameClipUris[0].uri+'" type="video/mp4">';
returnVideo += ' </video>';
returnVideo += ' </div>';
returnVideo += ' </div><br />';
});
$('#loading').hide("slow");
$('#retourForm').append(returnVideo);
}
});
It lacks the control buttons of the video player!
I have test to add player with url hardcoded and it work (right in image)...
So I guess I can not load html5 player from javascript?
Upvotes: 4
Views: 3469