-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVODdisplay.php
47 lines (40 loc) · 1.67 KB
/
VODdisplay.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
//Configure
$server = "pittsfieldtv.dyndns.org";
date_default_timezone_set('America/New_York');
// End Configure
$client = new SoapClient("http://" . $server . "/CablecastWS/CablecastWS.asmx?WSDL"); // Creates New SOAP client using WSDL file
$searchDate = date("Y-m-d")."T12:00:00";
// Search for all shows that have an event date less than now that are available for VOD
$result = $client->AdvancedShowSearch(array(
'ChannelID' => 1,
'searchString' => '',
'eventDate' => date("Y-m-d") . "T00:00:00",
'dateComparator' => '<',
'restrictToCategoryID' => 0,
'restrictToProducerID' => 0,
'restrictToProjectID' => 0,
'displayStreamingShowsOnly' => 1,
'searchOtherSites' => 0,));
if(!isset($result->AdvancedShowSearchResult->SiteSearchResult->Shows->ShowInfo)) {
$vods = array();
} else {
$vods = is_array($result->AdvancedShowSearchResult->SiteSearchResult->Shows->ShowInfo) ?
$result->AdvancedShowSearchResult->SiteSearchResult->Shows->ShowInfo :
array($result->AdvancedShowSearchResult->SiteSearchResult->Shows->ShowInfo);
}
if(count($vods) == '0') {
//There is probably something wrong if this shows up.
echo "There are now Shows currently available for on demand viewing.";
} else {
// Prints out a table with time and show title with link to show detial page
echo "<table>\n";
echo "<th>Program Title</th><th>Link</th></tr>\n";
foreach($vods as $vod) {
echo "<tr>\n";
echo "<td>" . $vod->Title . "</td>\n";
echo "<td><a href='" . $vod->StreamingFileURL . "'>Watch Now</a></td>";
echo "</tr>\n";
}
echo "</table>";
}