Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selected video thumbnail not showing in streamfields #81

Open
quaintjames opened this issue Aug 4, 2021 · 1 comment
Open

Selected video thumbnail not showing in streamfields #81

quaintjames opened this issue Aug 4, 2021 · 1 comment
Labels

Comments

@quaintjames
Copy link

When selecting a video the first time around, the video thumbnail is shown next to the video selection button
image
, however after publishing and revisiting the page, the thumbnail is no longer next to the 'choose a video' button.
image

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.

@seb-b seb-b added the bug label Aug 4, 2021
@tr-j
Copy link

tr-j commented Sep 30, 2021

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);
    });
})

fredevery added a commit to typecode/wagtailvideos that referenced this issue May 16, 2022
Hacked as per this discussion: neon-jungle#81
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants