Open quaintjames opened 3 years ago
I am having the same issue. The value of the video is available in the hidden input field after rendering, but doesn't seem to be available when the chooser is being created. This workaround corrects the preview image for me after rendering, but it doesn't fix the underlying missing value.
wagtailvideos/static/wagtailvideos/js/video-chooser.js (line 8, after variable declarations):
document.addEventListener('DOMContentLoaded', event => {
var input = $('#' + id);
let call_url = window.chooserUrls.videoChooser + input.val();
$.ajax(call_url).done(function(data) {
let videoData = data.result
input.val(videoData.id);
previewVideo.attr({
src: videoData.preview.url,
alt: videoData.title
});
chooserElement.removeClass('blank');
editLink.attr('href', videoData.edit_link);
});
})
When selecting a video the first time around, the video thumbnail is shown next to the video selection button , however after publishing and revisiting the page, the thumbnail is no longer next to the 'choose a video' button.
The video has been selected and the database information is correct, but the video thumbnail is not fetched and the buttons are reset to their original state, which may leave users thinking that there is no video uploaded.