Skip to content

vaersaagod/escape-dam-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Escape DAM plugin for Craft CMS 5.x

Escape DAM integration

Using Escape DAM

Enable videos

To enable selecting videos from the DAM, the "Video" file kind must be checked under the DAM field's "Restrict allowed file types?" setting.

DAM field asset properties and methods

The plugin adds the following extra methods to assets:

isDamFile bool (true if the asset was imported from the DAM)

isDamImage bool (true if the asset was imported from the DAM, and is an image)

isDamVideo bool (true) if the asset was imported from the DAM, and is a video)

getMuxPlaybackId() string|null Returns the Mux playback ID if the asset is an imported video; null if not.

getDamVideoStreamUrl() string|null Returns the Mux URL to the HLS stream, if the asset is an imported video; null if not.

getDamVideoData() array|null Returns all the DAM data for an imported video asset; null if the asset is not a DAM video.

getDamVideoTag($params=[], $polyfill=true) string|null Returns a video tag if the asset is an imported video asset. Example usage:

{% set asset = entry.damField.one() %}
{% if asset and asset.isDamVideo %}
   {{ asset.getDamVideoTag({ autoplay: true, muted: true, poster: false })|attr({ class: 'absolute inset-0 w-full h-full object-fit' }) }} 
{% endif %}

getDamVideoImageUrl($params=[]) string|null Returns the URL to an image from the video, if the asset is an imported video asset. See https://docs.mux.com/guides/video/get-images-from-a-video#thumbnail-query-string-parameters for possible params.

getDamVideoGifUrl() string|null Returns the URL to an animated GIF from the video, if the asset is an imported video asset. See https://docs.mux.com/guides/video/get-images-from-a-video#animated-gif-query-string-parameters for possible params.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors