Skip to content

Conversation

@bennothommo
Copy link
Member

@bennothommo bennothommo commented Aug 2, 2023

This PR adds a video preview image for mediafinder fields that have their mode config set to video. It renders the video screenshot by loading the first 10 seconds of the video and uses a HTML5 canvas element to take a snapshot as an image (stopping the video load afterwards).

image

In the course of this, I have also rewritten Media Finder to a Snowboard widget.

Only things left to do are:

  • Make sure it works in preview and update contexts
  • Perhaps cache or save the preview image so it doesn't have to load the video.
  • Put something in place if the video cannot load (placeholder image perhaps?)
  • Add preview for audio mode.

@bennothommo bennothommo added enhancement PRs that implement a new feature or substantial change Status: In Progress labels Aug 2, 2023
@bennothommo bennothommo added this to the v1.2.4 milestone Aug 2, 2023
@LukeTowers
Copy link
Member

Something that I'd like to do as a general pattern across all our frontend development is to ensure that all assets live under either dist/ or src/ folders, with the objective being that /src folders aren't expected to exist on production servers or be persisted to CDNs.

So assets/dist/js vs assets/js/dist

echo $this->makePartial('image_single');
break;
case 'video':
case 'audio':
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will the preview be for an audio file? Was this missed here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I do intend to add an audio player to the backend field preview if an audio file is selected.

@LukeTowers
Copy link
Member

With this and #958 it's looking more and more like we need to get #16 done as the thumbnail is definitely something that should stored in the item's metadata.

@LukeTowers LukeTowers modified the milestones: v1.2.4, 1.2.5 Dec 27, 2023
@mjauvin mjauvin modified the milestones: 1.2.5, 1.2.6 Feb 18, 2024
@LukeTowers LukeTowers modified the milestones: 1.2.6, 1.3.0 Apr 25, 2024
@LukeTowers
Copy link
Member

@bennothommo what's the status of this?

@bennothommo
Copy link
Member Author

I've held this work until we have media library metadata in place.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement PRs that implement a new feature or substantial change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants