<?php

/**
 * @package         Smile Pack
 * @version         1.2.3 Pro
 * 
 * @author          Tassos Marinos <info@tassos.gr>
 * @link            http://www.tassos.gr
 * @copyright       Copyright © 2024 Tassos Marinos All Rights Reserved
 * @license         GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> or later
*/

defined('_JEXEC') or die;

if (!$videoURL = $params->get('vimeo_value'))
{
	return;
}

$arrayParams = $params->toArray();

$payload = [
	'value' => $videoURL,
	'width' => isset($arrayParams['width']) ? $arrayParams['width'] : null,
	'height' => isset($arrayParams['height']) ? $arrayParams['height'] : null,
	'privacy' => $params->get('privacyMode', '0') === '1',
	
	'controls' => $params->get('controls', '1') === '1',
	'loop' => $params->get('loop', '0') === '1',
	'mute' => $params->get('mute', '0') === '1',
	'autoplay' => $params->get('autoplay', '0') === '1',
	'autopause' => $params->get('autopause', '0') === '1',
	'title' => $params->get('title', '0') === '1',
	'byline' => $params->get('byline', '0') === '1',
	'portrait' => $params->get('portrait', '0') === '1',
	'pip' => $params->get('pip', '0') === '1',
	'speed' => $params->get('speed', '0') === '1',
	'color' => $params->get('vimeo_color'),
	'keyboard' => $params->get('disablekb', '0') === '0',
	'start' => $params->get('start', ''),
	'end' => $params->get('end', ''),
	'coverImageType' => $params->get('coverImageType', false),
	'coverImage' => $params->get('coverImage', ''),
	
];

echo \NRFramework\Widgets\Helper::render('Vimeo', $payload);