Programme class
The Programme class represents an entry in a programme schedule.
Note: as described in the record( Programme programme ) method of the application/oipfRecordingScheduler object, only the programmeID property of the programme object is used to determine the programme or series that will be recorded. The other properties are solely used for annotation of the (scheduled) recording with programme metadata. The use of these metadata properties is optional. If such programme metadata is provided, it is retained in the ScheduledRecording object that is returned if the recording of the programme was scheduled successfully.
Constants
| Name | Value | Use |
|---|
| ID_TVA_CRID | 0 | Used in the programmeIDType property to indicate that the programme is identified by its TV-Anytime CRID (Content Reference Identifier). |
| ID_DVB_EVENT | 1 | Used in the programmeIDType property to indicate that the programme is identified by a DVB URL referencing a DVB-SI event as enabled by section 4.1.3 of [OIPF_META2]. OPTIONAL. |
| ID_TVA_GROUP_CRID | 2 | Used in the programmeIDType property to indicate that the Programme object represents a group of programmes identified by a TV-Anytime group CRID. |
The constants defined above are supported however support for CRIDs is currently outside the scope of HbbTV.
Properties
| String name |
| The short name of the programme, e.g. ‘Star Trek: DS9’. |
| String description |
The description of the programme, e.g. an episode synopsis. If no description is available, this property will be undefined. |
| String longDescription |
| The long description of the programme. If no description is available, this property will be undefined. |
| Integer startTime |
| The start time of the programme, measured in seconds since midnight (GMT) on 1/1/1970. |
| Integer duration |
| The duration of the programme (in seconds). |
| String channelID |
The identifier of the channel from which the broadcasted content is to be recorded. Specifies either a ccid or ipBroadcastID (as defined by the Channel object). |
| String programmeID |
| The unique identifier of the programme or series, e.g., a DVB Event URL. |
| Integer programmeIDType |
| The type of identification used to reference the programme, as indicated by one of the ID_* constants defined above. |
| readonly ParentalRatingCollection parentalRatings |
A collection of parental rating values for the programme for zero or more parental rating schemes supported by the terminal. For instances of the Programme class created by the createProgramme() method defined in section 7.10.1.1, the initial value of this property (upon creation of the Programme object) is an instance of the ParentalRatingCollection object (as defined in section 7.9.5) with length 0. Parental rating values can be added to this empty readonly parental rating collection by using the addParentalRating() method of the ParentalRatingCollection object. The ParentalRatingCollection is defined in section 7.9.5. The related ParentalRating and ParentalRatingScheme objects are defined in section 7.9.4 and 7.9.2 respectively. For instances of the Programme class returned through the metadata APIs defined in section 7.12 or through the programmes property of the video/broadcast object defined in section 7.13.3, the initial value of this property will include the parental rating value(s) carried in the metadata or DVB-SI entry describing the programme, if this information is included.
Note that if the service provider specifies a certain parental rating (e.g. PG-13) through this property and the actual parental rating extracted from the stream says that the content is rated PG-16, then the conflict resolution is implementation dependent. |
Methods
| StringCollection getSIDescriptors( Integer descriptorTag, Integer descriptorTagExtension, Integer privateDataSpecifier ) |
| Description | Get the contents of the descriptor specified by descriptorTag from the DVB SI EIT programme’s descriptor loop. If more than one descriptor with the specified tag is available for the given programme, the contents of all matching descriptors will be returned in the order the descriptors are found in the stream.
The descriptor content bytes are encoded in a string whose characters are restricted to the ISO Latin-1 character set. Each character in the string represents a byte of a DVB-SI descriptor, such that a byte at position “i” in the descriptor is equal the Latin-1 character code of the character at position “i” in the string.
Described in the syntax of JavaScript: let desc[ ] be the byte array of a descriptor, in which desc[0] is the descriptor_tag, then, the returned string (retval in the example below) is its equivalent string, if :
desc.length==retval.length and for each integer i : 0<=i<desc.length holds desc[i] == retval.charCodeAt(i).
If the descriptor specified by descriptorTag and (optionally) descriptorTagExtension and privateDataSpecifier does not exist, or if the metadata for this programme was retrieved from a source other than DVB-SI, this method will return null.
If metadata for this programme has not yet been retrieved, this method will return undefined. If the terminal supports the application/oipfSearchManager object, the terminal will notify applications of the availability of additional metadata via MetadataSearch events targeted at the application/oipfSearchManager object used to retrieve the programme metadata. |
| Arguments | descriptorTag | The descriptor tag as specified by [EN 300 468]. |
| descriptorTagExtension | An optional argument giving the descriptor tag extension as specified by [EN 300 468]. This argument is mandatory when descriptorTag is 0x7f and ignored in all other cases. |
| privateDataSpecifier | An optional argument giving the private_data_specifier as specified by [EN 300 468]. If this argument is present, only descriptors related to the identified specifier will be returned. |
Additional Notes
Risk of tampering with data returned by APIs
Application developers should be aware that some APIs return data that may not be authenticated. In some circumstances an attacker may be able to modify the broadcast signalling from which this data is derived. This particularly applies to the properties and methods of the Channel and Programme classes:
- Applications should be written to be tolerant of values which are outside the expected range without hanging up, locking up or crashing.
- Applications should treat the values returned by name, Programme.name, Programme.description and Programme.longDescription with caution as an attacker may modify the broadcast signalling to include HTML or JavaScript as well as values that are outside the expected set. Applications shall not use the data returned by these properties in a way that would result in them being executed by the browser.
- Applications should treat data returned by the getSIDescriptors method with caution. Applications shall not use this data in a way that would result in that such data being executed by the browser. Applications should be written to be tolerant of values which are outside the expected range without hanging up, locking up or crashing.
Recording extensions to Programme
Recording extensions to Programme if the PVR feature is enabled. [THIS SECTION SHOULD ME MOVED TO THE PVR SECTION]
Properties
| readonly ScheduledRecording recording |
| If available, this property represents the recording associated with this programme (either scheduled, in-progress or completed). Has value undefined if this programme has no scheduled recording associated with it. |