UNPKG

react-jw-player-ts

Version:

A fork of react-jw-player rewritten in typescript

30 lines (29 loc) 858 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function getPlayerOpts(props) { const { aspectRatio, file, image, isAutoPlay, isMuted, licenseKey, playlist, customProps } = props; const playerOpts = {}; if (licenseKey) { playerOpts.key = licenseKey; } if (playlist) { playerOpts.playlist = playlist; } else if (file) { playerOpts.file = file; } if (aspectRatio && aspectRatio !== 'inherit') { playerOpts.aspectratio = aspectRatio; } if (typeof isAutoPlay !== 'undefined') { playerOpts.autostart = !!isAutoPlay; } if (typeof isMuted !== 'undefined') { playerOpts.mute = !!isMuted; } if (image) { playerOpts.image = image; } return Object.assign(playerOpts, customProps); } exports.default = getPlayerOpts;