Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
VP Factory API example code (external playlists)
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  1 message - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
VP Factory  
View profile  
 More options Nov 4 2010, 4:29 pm
From: VP Factory <cont...@vpfactory.com>
Date: Thu, 4 Nov 2010 13:29:09 -0700 (PDT)
Local: Thurs, Nov 4 2010 4:29 pm
Subject: VP Factory API example code (external playlists)
This example will show you how to create a playlist outside your
player, together with thumbnails, video description and other video
information.

<?php
require_once('../misc/api/apivpf.class.php');
$api = new ApiVPF($key);
$xml_playlist = $api-

>getPlaylist('caf1a3dfb505ffed0d024130f58c5cfa');

$myPlaylist = simplexml_load_string($xml_playlist);
$playlist_title = $myPlaylist->name;
$playlist_videos = $myPlaylist->videos->video;
$videos = array();
foreach ($playlist_videos as $video) {
        $xml_video = $api->getVideo($video);
        $myVideo = simplexml_load_string($xml_video, NULL,
LIBXML_NOCDATA);
        $myVideo->title = str_replace('<![CDATA[', '', (string)
$myVideo-

>title);

        $myVideo->title = str_replace(']]>', '', (string)$myVideo-
>title);

        array_push($videos, $myVideo);

}

$player_txtid = 'b337e84de8752b27eda3a12363109e80';
$first_video = '';
if (isset($videos[0]->mdid)) {
        $first_video = $videos[0]->mdid;

}

?>
Notes:
To build the HTML playlist menu, we parse the $videos array for its
attributes.
To build the player, we embed it using the following code:

<script type="text/javascript">
        var id = "<?php echo $player_txtid; ?>";
        var serverURL = "<?php echo $api->serverURL(); ?>";
        var firstVideo = "<?php echo $first_video; ?>";
        var refVideo = swfobject.getQueryParamValue("referralVideo");

        if (refVideo == '' && firstVideo != '') {
                refVideo = firstVideo;
        }

        if (id != '') {
                var flashvars = {
                        htmlPage: document.location,
                        referralVideo: refVideo,
                        settingsFile: "/publicfeed/?id=" + id
                };
                var params = {
                        allowFullScreen: "true",
                        allowScriptAccess: "always",
                        wmode: "transparent"
                };
                swfobject.embedSWF(serverURL + "/videoPlayer.swf", "vpf" + id,
"100%", "100%", "9.0.115", serverURL + "/swfobject/
expressInstall.swf", flashvars, params);
        }
</script>


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic