Download the Sample Code
A very frequent question we get is this...
How can I get access to the built in Media Center Electronic Programming Guide so I can tune to a particular show or channel directly from my application?
Microsoft has abstracted the EPG information in such a way to make it fairly easy to tune to a particular TV channel or show without having access to the human readable data or having to maintain a database themselves for each individual user with the unique one:one mapping of channel numbers and broadcasts.
The almost-as-frequent followup question is...
Why can't I just search and manipulate the data itself?
The data itself is locked up tight due to licensing issues. For what it is worth I personally wish this were different. However, I do like the fact we can still leverage the EPG to make really great and well integrated applications for hybrid TV / internet experiences at the same time we respect the metadata owner rights. No baby thrown out with the bath water this time.
Use the FindProgram and / or FindService methods in conjunction with the PlayMedia or PlayMediaEx method to find and tune to shows or broadcast channels. The key lines of sample code in each...
FindProgram
var arrayProgram = objMCE.FindProgram("Little House on The Prairie",true); 'Nuff said -- find the show.
var arrayProgram = objMCE.FindProgram("Little House on The Prairie",true);
'Nuff said -- find the show.
FindService
var arrayService = objMCE.FindService("DSCP", ""); DSCP = Discovery Channel (Pacific). The call signs are generally determined by the broadcast channel owner and are finite in each locale (for example, the Discovery has DSCP for West Coast and DSC for all other time zones in the United States).
var arrayService = objMCE.FindService("DSCP", "");
DSCP = Discovery Channel (Pacific). The call signs are generally determined by the broadcast channel owner and are finite in each locale (for example, the Discovery has DSCP for West Coast and DSC for all other time zones in the United States).
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.