Hello there.. im new to roku developing field
the channel i'm currently making is a video on demand type of app. i used videoplayer sdk
i hosted my categories.xml in to XML folder and named categories.php (local server)
categories.php code (categories.xml)
in categoryFeed.brs file i modified to this
conn.UrlPrefix = "file://pkg:/xml/categories.php"
conn.UrlCategoryFeed = conn.UrlPrefix + ""
categories.php looks like this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<categories>
<category title="Video On Demand" description="2015" sd_img="http://mywebsite.com/images/vod1155.png" hd_img="http://mywebsite.com/images/vod1155.png">
<categoryLeaf title="The Mind" description="" feed="http://webgurutech.com/roku/vod.php"/>
</category>
</categories>
and it worked perfectly alright. i can view the video contents in
http://webgurutech.com/roku/vod.phpmy problem is here
i hosted this vod.php file in xml folder where the categories.php in
and changed categories.php xml file line like this
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<categories>
<category title="Video On Demand" description="2015" sd_img="http://mywebsite.com/images/vod1155.png" hd_img="http://mywebsite.com/images/vod1155.png">
<categoryLeaf title="The Mind" description="" feed="file://pkg:/xml/vod.php"/>
</category>
</categories>
but the xml is not opening.
i checked in telnet and it shows this
Request Time: 1
Can't parse feed
This vod.php is feteching from a differnet xml which wont support in videoplayer
this is how the real xml looks like
http://webgurutech.com/roku/cat.xml and i used some php scripts to make it like
http://webgurutech.com/roku/vod.php this.
this is vod.php script
<?php
header('Content-Type:text/xml');
error_reporting(E_ALL);
$url = 'http://webgurutech.com/roku/cat.xml';
if (($response_xml_data = file_get_contents($url))===false){
echo "Error fetching XML\n";
} else {
libxml_use_internal_errors(true);
$data = simplexml_load_string($response_xml_data);
if (!$data) {
echo "Error loading XML\n";
foreach(libxml_get_errors() as $error) {
echo "\t", $error->message;
}
} else {
$vodXML = '<feed>
<endIndex>4</endIndex>
<resultLength>4</resultLength>'.PHP_EOL;
$vods = $data->code->vodList->vod;
for( $v=0; $v<count($vods);$v++) {
$vod = $vods[$v];
$vodItemXML .= '<item sdImg="' . $vod->attributes()->SDPosterUrl . '" hdImg="' . $vod->attributes()->HDPosterUrl . '">
<ContentType>'. $vod["ContentType"] .'</ContentType>
<title>' . $vod->attributes()->Title . '</title>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<media>
<streamUrl>' . $vod->attributes()->urls . '</streamUrl>
<streamFormat>mp4</streamFormat>
<streamQuality>SD</streamQuality>
</media>
<synopsis>' . $vod->attributes()->ShortDescriptionLine1 . '</synopsis>
<streamformat>' . $vod->attributes()->Streamformat . '</streamformat>
</item>'.PHP_EOL;
}
$vodXML .= $vodItemXML . '</feed>';
echo $vodXML;
}
}
in browser it will open as xml file.
i want this vod.php file to be in local server /xml/ folder of videoplayer.zip (not in web server= websites)
does roku read php file. how can i make it work ? some one please help
im sorry for this long post
🙂