UNPKG

@aidenlx/player

Version:

Headless web components that make integrating media on the a web a breeze.

21 lines (20 loc) 712 B
import "../../chunks/chunk.LNH2V2XS.js"; import { isNumber, isString } from "@vidstack/foundation"; import { MediaStyleController } from "./MediaStyleController"; class MediaCssPropsController extends MediaStyleController { _handleValueChange(_, attrName, value) { this._host.style.setProperty(this._getCssPropName(attrName), isString(value) || isNumber(value) ? String(value) : null); } _getCssPropName(attrName) { return `--vds-${attrName}`; } _handleDisconnect(_, attrName) { this._host.style.setProperty(this._getCssPropName(attrName), null); } } function bindMediaPropsToCssProps(...params) { return new MediaCssPropsController(...params); } export { bindMediaPropsToCssProps };