<commit_before><?php
namespace Chamilo\Core\Repository\ContentObject\File\Common\Rendition\Html;

use Chamilo\Core\Repository\ContentObject\File\Common\Rendition\Html\HtmlInlineMediaRenditionImplementation;
use Chamilo\Core\Repository\ContentObject\File\Storage\DataClass\File;
use Chamilo\Libraries\File\Path;
use Chamilo\Libraries\Format\Utilities\ResourceManager;
use Chamilo\Libraries\Utilities\Utilities;

/**
 *
 * @package Chamilo\Core\Repository\ContentObject\File\Common\Rendition\Html
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */
abstract class HtmlInlineMediaElementRenditionImplementation extends HtmlInlineMediaRenditionImplementation
{

    /**
     *
     * @see \Chamilo\Core\Repository\ContentObject\File\Common\Rendition\Html\HtmlInlineRenditionImplementation::render()
     */
    public function render($parameters)
    {
        $html = array();
        
        $html[] = ResourceManager::getInstance()->get_resource_html(
            Path::getInstance()->getJavascriptPath(Utilities::COMMON_LIBRARIES, true) .
                 'Plugin/MediaElementJS/build/mediaelement-and-player.min.js');
        
        $html[] = ResourceManager::getInstance()->get_resource_html(
            Path::getInstance()->getJavascriptPath(Utilities::COMMON_LIBRARIES, true) .
                 'Plugin/MediaElementJS/build/mediaelementplayer.css');
        
        $html[] = ResourceManager::getInstance()->get_resource_html(
            Path::getInstance()->getJavascriptPath(File::package(), true) . 'MediaElementJS.js');
        
        $html[] = $this->getMediaElement();
        
        $html[] = '<div class="clearfix"></div>';
        
        return implode(PHP_EOL, $html);
    }

    /**
     *
     * @param string[] $parameters
     *
     * @return string
     */
    public function getMediaElement($parameters)
    {
        $html = array();
        
        $html[] = '<div class="media-element-js-container">';
        
        $html[] = '<' . $this->getMediaElementType() . ' class="media-element-js-element">';
        $html[] = $this->getSources($parameters);
        $html[] = '</' . $this->getMediaElementType() . '>';
        
        $html[] = $this->getErrorMessage(false);
        
        $html[] = '<div class="media-element-js-download">';
        $html[] = $this->renderActions();
        $html[] = '</div>';
        
        $html[] = '</div>';
        
        return implode(PHP_EOL, $html);
    }

    /**
     *
     * @param string[] $parameters
     *
     * @return string<commit_msg>[Video] Possible fix for video files<commit_after><?php
namespace Chamilo\Core\Repository\ContentObject\File\Common\Rendition\Html;

use Chamilo\Core\Repository\ContentObject\File\Common\Rendition\Html\HtmlInlineMediaRenditionImplementation;
use Chamilo\Core\Repository\ContentObject\File\Storage\DataClass\File;
use Chamilo\Libraries\File\Path;
use Chamilo\Libraries\Format\Utilities\ResourceManager;
use Chamilo\Libraries\Utilities\Utilities;

/**
 *
 * @package Chamilo\Core\Repository\ContentObject\File\Common\Rendition\Html
 * @author <NAME> <<EMAIL>>
 * @author <NAME> <<EMAIL>>
 */
abstract class HtmlInlineMediaElementRenditionImplementation extends HtmlInlineMediaRenditionImplementation
{

    /**
     *
     * @see \Chamilo\Core\Repository\ContentObject\File\Common\Rendition\Html\HtmlInlineRenditionImplementation::render()
     */
    public function render($parameters)
    {
        $html = array();
        
        $html[] = ResourceManager::getInstance()->get_resource_html(
            Path::getInstance()->getJavascriptPath(Utilities::COMMON_LIBRARIES, true) .
                 'Plugin/MediaElementJS/build/mediaelement-and-player.min.js');
        
        $html[] = ResourceManager::getInstance()->get_resource_html(
            Path::getInstance()->getJavascriptPath(Utilities::COMMON_LIBRARIES, true) .
                 'Plugin/MediaElementJS/build/mediaelementplayer.css');
        
        $html[] = ResourceManager::getInstance()->get_resource_html(
            Path::getInstance()->getJavascriptPath(File::package(), true) . 'MediaElementJS.js');
        
        $html[] = $this->getMediaElement($parameters);
        
        $html[] = '<div class="clearfix"></div>';
        
        return implode(PHP_EOL, $html);
    }

    /**
     *
     * @param string[] $parameters
     *
     * @return string
     */
    public function getMediaElement($parameters)
    {
        $html = array();
        
        $html[] = '<div class="media-element-js-container">';

        $html[] = '<' . $this->getMediaElementType() . ' class="media-element-js-element" style="max-width: 100%;">';
        $html[] = $this->getSources($parameters);
        $html[] = '</' . $this->getMediaElementType() . '>';
        
        $html[] = $this->getErrorMessage(false);
        
        $html[] = '<div class="media-element-js-download">';
        $html[] = $this->renderActions();
        $html[] = '</div>';
        
        $html[] = '</div>';
        
        return implode(PHP_EOL, $html);
    }

    /**
     *
     * @param string[] $parameters
     *
     * @return string
{'fraction_non_alphanumeric': 0.15618305744888022, 'fraction_numerical': 0.0005842259006815969, 'mean_word_length': 2.8072646404744255, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '24040', 'n_tokens_mistral': 1494, 'n_tokens_neox': 1507, 'n_words': 196}