Error message

User warning: The following module is missing from the file system: fast_404. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1143 of /mnt/www/html/ooyala/docroot/includes/bootstrap.inc).

Comparación: Crear programación con XML y con llamadas a la API

A continuación se presenta una comparación para crear una programación con XML y con llamadas a la API.

Esta programación ficticia solo incluye tres horas para un día determinado. En realidad, sus programaciones suelen ser para un día entero o más tiempo.

XML de programación

  1. Cree una pista con la llamada /v2/track:
         [POST] /v2/tracks
         {
            "name" : "Sample schedule"
         }
        
  2. Construya el XML, utilizando Sample schedule como el valor del elemento <NETWORK>. Se definen tres combinaciones diferentes de segmento de pista/vídeo virtual, con bloques de tiempo contiguos.
    <?xml version="1.0"?>
    <EPG>
      <BROADCAST_DAY>
        <TX_DAY>2013-04-15</TX_DAY>
        <PROGRAM>
          <VIRTUAL_ASSET_ID>VirtualAsset1</VIRTUAL_ASSET_ID>
          <TRACK_SEGMENT_ID>TrackSegment1</TRACK_SEGMENT_ID>
          <NETWORK>Sample schedule</NETWORK>
          <SHORT_TITLE>A Nice Title</SHORT_TITLE>
          <EPISODE_NAME>Episode 1</EPISODE_NAME>
          <EPISODE_ID>1</EPISODE_ID>
          <DESCRIPTION>A Nice Description</DESCRIPTION>
          <PROGRAM_TYPE>Some Type</PROGRAM_TYPE>
          <START_TIME>2013-04-15T19:00Z</START_TIME>
          <END_TIME>2013-04-15T20:00Z</END_TIME>
          <DURATION>01:00</DURATION>
          <TV_RATING>PG</TV_RATING>
          <PROGRAM_STATUS>offline</PROGRAM_STATUS>
          <CUSTOM_METADATA>
              <FIELD NAME="MYFIELD1">My value</FIELD>
              <FIELD NAME="another_field_name">another field value<FIELD> 
          </CUSTOM_METADATA>
        </PROGRAM>
        <PROGRAM>
          <VIRTUAL_ASSET_ID>VirtualAsset2</VIRTUAL_ASSET_ID>
          <TRACK_SEGMENT_ID>TrackSegment2</TRACK_SEGMENT_ID>
          <NETWORK>Sample schedule</NETWORK>
          <SHORT_TITLE>Another Nice Title</SHORT_TITLE>
          <EPISODE_NAME>Episode 2</EPISODE_NAME>
          <EPISODE_ID>2</EPISODE_ID>
          <DESCRIPTION>Another Nice Description</DESCRIPTION>
          <PROGRAM_TYPE>Some Type</PROGRAM_TYPE>
          <START_TIME>2013-04-15T20:00Z</START_TIME>
          <END_TIME>2013-04-15T21:00Z</END_TIME>
          <DURATION>01:00</DURATION>
          <TV_RATING>PG</TV_RATING>
          <PROGRAM_STATUS>offline</PROGRAM_STATUS>
          <CUSTOM_METADATA>
              <FIELD NAME="MYFIELD1">My value</FIELD>
              <FIELD NAME="another_field_name">another field value<FIELD> 
          </CUSTOM_METADATA>
        </PROGRAM>
        <PROGRAM>
          <VIRTUAL_ASSET_ID>VirtualAsset3</VIRTUAL_ASSET_ID>
          <TRACK_SEGMENT_ID>TrackSegment3</TRACK_SEGMENT_ID>
          <NETWORK>Sample schedule</NETWORK>
          <SHORT_TITLE>Another Nice Title</SHORT_TITLE>
          <EPISODE_NAME>Episode 3</EPISODE_NAME>
          <EPISODE_ID>3</EPISODE_ID>
          <DESCRIPTION>Another Nice Description</DESCRIPTION>
          <PROGRAM_TYPE>Some Type</PROGRAM_TYPE>
          <START_TIME>2013-04-15T21:00Z</START_TIME>
          <END_TIME>2013-04-15T22:00Z</END_TIME>
          <DURATION>01:00</DURATION>
          <TV_RATING>PG</TV_RATING>
          <PROGRAM_STATUS>offline</PROGRAM_STATUS>
          <CUSTOM_METADATA>
              <FIELD NAME="MYFIELD1">My value</FIELD>
              <FIELD NAME="another_field_name">another field value<FIELD> 
          </CUSTOM_METADATA>
        </PROGRAM>
      </BROADCAST_DAY>
    </EPG> 
        
  3. Coloque el archivo en el servidor FTP de Ooyala.
    ftp epg-ftp.us-east-1.ooyala.com
    put filename
    exit
        

Llamadas a la API equivalente

  1. Cree una pista con la llamada /v2/track:
         [POST] /v2/tracks
         {
            "name" : "Sample schedule"
         }
        
  2. Cree tres vídeos virtuales, incluyendo los metadatos myfield1.
         [POST] /v2/virtual_assets
         {
              "name" : "VirtualAsset1"
              "myfield1" : "My value"
         }
         [POST] /v2/virtual_assets
         {
              "name" : "VirtualAsset2"
              "myfield1" : "My value"
         }
         [POST] /v2/virtual_assets
         {
              "name" : "VirtualAsset3"
              "myfield1" : "My value"
         }     
        

    Registre el virtual_asset_id devuelto para cada llamada.

  3. Cree tres segmentos de pista para la pista Sample schedule. Cada uno de ellos se refiere a una propiedad virtual diferente.
         [POST] /v2/track_segments
         {
         "track_id": "Sample schedule",
         "start_time": "2013-04-15T19:00Z", 
         "end_time": "2013-04-15T20:00Z",
         "status": "offline", 
         "virtual_asset_id": "id_for_virtualasset1"
         }
         [POST] /v2/track_segments
         {
         "track_id": "Sample schedule",
         "start_time": "2013-04-15T20:00Z", 
         "end_time": "2013-04-15T21:00Z",
         "status": "offline", 
         "virtual_asset_id": "id_for_virtualasset2"
         }
         [POST] /v2/track_segments
         {
         "track_id": "Sample schedule",
         "start_time": "2013-04-15T23:00Z", 
         "end_time": "2013-04-15T22:00Z",
         "status": "offline", 
         "virtual_asset_id": "id_for_virtualasset3"
         }