How to put UOL videos on Jwplayer

Asked

Viewed 619 times

1

Hello, I would like to know how to get videos from the code embed from UOL player videos and by to work on Jwplayer. I found the code below, he in the case catches the url and converts with everything like url of UOL. Changed guidelines, but it’s not working. Someone could help me with this.

To url of video UOL.

The code to convert url:

<?php
    //----------------------------------------------------------------------------
    // FUNÇÃO CURL PARA URL FILE DISABLE - SIMPLE XML LOAD
    //----------------------------------------------------------------------------  

        function curlXML($url) {
            $ch = curl_init();
            curl_setopt ($ch, CURLOPT_URL, $url);
            curl_setopt ($ch, CURLOPT_HEADER, 0);
            curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);       
            curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 0);
            $data = curl_exec($ch);
            curl_close($ch);
            $xml = new SimpleXMLElement($data);

            return $xml;
        }
        // Verifico se existe no servidor a função curl.
        function carrega_xml ($url) {
            if (ini_get('allow_url_fopen')){
                $xml = simplexml_load_file($url);
            } else {
                $xml = $this->curlXML($url);
            }
            return $xml;
        }

        $video = carrega_xml('http://videolog.uol.com.br/swfs/related/related-player-publicididade.php?id_video='.$_GET['v']);
        echo $video->item->video;
        if ($video->item->video_hd){
            echo $video->item->video_hd;
        }
    ?> 

In this case, the above code also generates download link, but only need it to work with the url current. I thank anyone who can help me.

"Would anyone know to tell me any alternative way to get the url of the UOL videos, but to be able to put in Jwplayer, if there is no solution for the functioning of this code".

  • Does anyone know how to do that ?

1 answer

1

I don’t think that’s necessary php, and that it is the same procedure to include videos from youtube.

According to this indication Jwplayer support the procedure is as follows:

1 - Add library inside tag head

This is the default link, but you can also download the version Self-hosted:

<script src="http://jwpsrv.com/library/YOUR_JW_PLAYER_ACCOUNT_TOKEN.js" ></script>

You must change the YOUR_JW_PLAYER_ACCOUNT_TOKEN for his token jwplayer (this link can be found in your user account).

2 - Include the code embed within the tag body

<div id="myElement"></div>

<script>
    jwplayer("myElement").setup({
        file: "http://www.youtube.com/watch?v=8CjdLYBDUqw",
        width: 640,
        height: 360
    });
</script>

For more details, see the tutorial on the Jwplayer page.

  • 1

    Good evening Gustavo, in case his PHP seems to me only to take the link and not the data, something else jwplayer can only run youtube videos, because youtube provides an API to enable play/pause/stop/etc, I believe that the Uol player has no API (correct me if I’m wrong), other than an API to catch

  • Um, I get it, I think you’re right. In the case then Uol prohibits what the AP wants to do? Like, it hides the url just so there’s no way to run another site?

  • 1

    I think it does not prohibit, because he just wants to share, the only thing is not possible to do is customize the player as it is done on youtube, but it is not a ban, it is because the player is even limited. I’m not sure if their player has events like .play(), .stop(), .getPosition(), But if there is, then let’s just say it’s possible. But unfortunately I haven’t found any documentation, which makes me think that there isn’t one, even a pity.

  • 1

    And I tried to run after that, too, and I couldn’t find any way to generate a URL from UOL to put that in Jwplayer. And gustavox I appreciate the help only that youtube Jwplayer already have compatibility, my problem and even with UOL More that I could not get any tutorial or explanations of how to make a URL to be able to put their FLY to run in other online video player.

Browser other questions tagged

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