<?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('facebook_value'))
{
	return;
}

$arrayParams = $params->toArray();

$payload = [
	'value' => $videoURL,
	'width' => isset($arrayParams['width']) ? $arrayParams['width'] : null,
	'height' => null,
	
	'fs' => $params->get('fs', '1') === '1',
	'autoplay' => $params->get('autoplay', '0') === '1',
	'autopause' => $params->get('autopause', '0') === '1',
	'show_text' => $params->get('show_text', '0') === '1',
	'show_captions' => $params->get('show_captions', '0') === '1',
	
];

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