for some reason its still not pulling the pictures to roku below is the xml that i point to
http://www.lofbc.org/dev/roku/<item item="sdImg ='http://www.lofbc.org/roku/img/SDdefault.jpg' hdImg ='http://www.lofbc.org/roku/img/HDdefault.jpg'">
<title>Humility is Strife Free</title>
<contentId>2</contentId>
<media>
<contentType>Talk</contentType>
<contentQuality>SD</contentQuality>
<streamBitrate>1500</streamBitrate>
<streamFormat>mp4</streamFormat>
<StreamUrl>
http://lofbc-media.s3.amazonaws.com/2015/Video/mp4/20150125.mp4
</StreamUrl>
</media>
<synopsis>Pastor Stephen Fraser</synopsis>
<genres>religion</genres>
<runtime>0</runtime>
</item>
And this is my C#
protected void Page_Load(object sender, EventArgs e)
{
//clears previous output
Response.Clear();
Response.ContentType = "text/xml";
//XML Declartion tag
XmlTextWriter xml = new XmlTextWriter(Response.OutputStream, Encoding.UTF8);
xml.WriteStartDocument();
//Starts feed
xml.WriteStartElement("feed");
try
{
SqlDataReader reader;
//database connection
SqlConnection con = new SqlConnection(" ****;");
SqlCommand cmd = new SqlCommand(@"SELECT * FROM tbl_roku r INNER JOIN tbl_media_ministers m on
r.MinisterID = m.ID ORDER BY CreatedDate", con);
con.Open();
reader = cmd.ExecuteReader();
while (reader.Read())
{
var pubDate = reader[3].ToString();
var year = DateTime.Parse(pubDate).ToString("yyyy");
var sdImg = reader[6].ToString();
var hdImg = reader[7].ToString();
if (sdImg == "")
{
sdImg = "SDdefault.jpg";
}
if(hdImg == "")
{
hdImg = "HDdefault.jpg";
}
xml.WriteStartElement("item");
xml.WriteAttributeString("item","sdImg ='http://www.lofbc.org/roku/img/" + sdImg + "' hdImg ='http://www.lofbc.org/roku/img/" + hdImg +"'");
xml.WriteElementString("title", reader[1].ToString());
xml.WriteElementString("contentId", reader[0].ToString());
xml.WriteStartElement("media");
xml.WriteElementString("contentType", "Talk");
xml.WriteElementString("contentQuality", "SD");
xml.WriteElementString("streamBitrate", "1500");
xml.WriteElementString("streamFormat", "mp4");
xml.WriteElementString("StreamUrl", "http://lofbc-media.s3.amazonaws.com/" + year + "/Video/mp4/" + reader[5].ToString().Replace("flv", "mp4"));
xml.WriteEndElement();
xml.WriteElementString("synopsis", reader[11].ToString() + " " + reader[9].ToString() + " " + reader[10].ToString() + " " + reader[4].ToString());
xml.WriteElementString("genres", "religion");
xml.WriteElementString("runtime", "0");
xml.WriteEndElement();
}
reader.Close();
con.Close();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
xml.WriteEndElement();
xml.WriteEndDocument();
xml.Flush();
xml.Close();
Response.End();
}
}
The last question i have is on runtime how should that be formated all the examples show what i thought were seconds but they don't add up when i compute them.
Thanks