How to do url encoded in base64_encode and base64_decode, be loaded in jwplayer

Asked

Viewed 33 times

1

Ola would like your help to solve the following problem, I have a code that serves to make files from Mediafire, open in jwplayer. However I need url of Mediafire be coded. I tried to use base64_encode and base64_decode but I could not make it work in Wordpress.

I would like your help to implement the code below, so that the original url is inside the php code and the encoded url works in the player.

<?php 

    $mediafireVideo = explode('/', $valorFinalB);
    // dados da media
    $urlVideo =  $mediafireVideo[4];
    $arquivoVideo = file_get_contents('http://www.mediafire.com/file/' . $urlVideo. '/');
    $start = strpos($arquivoVideo, 'http://download');
    $end = strpos($arquivoVideo, "'",$start);
//echo "$start \n $end \n"  ;
    $arquivoVideo = substr($arquivoVideo, $start,$end - $start);
//echo $arquivoVideo;
    ?>
<div id="option-1<?php echo $numeradoB; ?>" class="play-box-iframe fixidtab">
<script src="https://content.jwplatform.com/libraries/fNkNmTXG.js"></script>
<div id="player-1<?php echo $numeradoB; ?>"></div>
<script type="text/javascript">// <![CDATA[
jwplayer('player-1<?php echo $numeradoB; ?>').setup({
    title: "<?php the_title(); ?>",
    image: "<?php echo esc_url($thumb_id); ?>",
    file: "<?php echo $arquivoVideo;  ?>",  
    mute: "false",
    autostart: "false",
    repeat: "false",
    height: "100%",
    width: "100%",
    stretching: "uniform",
    primary: "html5",
    flashplayer:"//cdn.jsdelivr.net/jwplayer/5.10/player.swf",
    preload:"metadata", 
logo: {
    file:'<?php echo $jwlogo2; ?>',
    hide:"false",
    margin:"15",
    position:'<?php echo $jwlogoposit2 ?>',
}   
  });
// ]]></script>
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.