動態饋給結構總覽

媒體動作動態饋給是 JSON 物件,其中包含實體集合。實體是 schema.org 物件,代表目錄中的項目,例如電視劇集、電影、歌曲、專輯等。

圖 1. 收看活動和收聽活動的動態消息結構。

動態饋給結構

Watch 動作和 Listen 動作的動態消息結構不同。

收視動作有以下階層:
聆聽動作有以下階層:

資料動態饋給封套

資料動態饋給封套是媒體動作動態饋給中的頂層物件。這個物件包含一組內容標記物件 (實體) 陣列,代表目錄中的所有內容。

資料動態饋給封套支援下列屬性:

屬性 類型 說明
@context 網址 必要:設為 http://schema.org
@type Text 必要:設為 DataFeed
dateModified DateTime 必填:動態饋給上次修改的日期和時間,採用 ISO 8601 格式 (包括時區)。
dataFeedElement Thing 的子類型 必填:媒體目錄的實體

資料動態饋給封套範本

{
  "@context": "http://schema.org",
  "@type": "DataFeed",
  "dateModified": "2018-07-20T00:44:51Z",
  "dataFeedElement": [
    { <CONTENT MARKUP OBJECT 01> },
    { <CONTENT MARKUP OBJECT 02> },
    { <CONTENT MARKUP OBJECT 03> },
    ...
  ]
}

內容標記

內容標記物件代表目錄中的單一實體,例如電影、電視劇集、歌曲、專輯、電台等。物件包含內容的識別碼和標準網址,並透過metadata說明內容。

內容標記範本

內容標記物件可包含 動作標記物件陣列,讓內容與多個動作標記物件建立關聯。舉例來說,內容可在每個區域使用不同的 Action 標記物件。

{
   "@context": ["http://schema.org", {"@language": "en"}],
   "@type": "Movie",
   "@id": "http://www.example.com/my_favorite_movie",
   "url": "http://www.example.com/my_favorite_movie",
   "name": "My Favorite Movie",
   "potentialAction": [
     { <ACTION MARKUP OBJECT 01> },
     { <ACTION MARKUP OBJECT 02> }
   ],
   ...
}

動作標記

動作標記物件會說明將使用者導向內容的深層連結,以及內容所需的存取層級。這個物件是內容標記物件的屬性 (potentialAction)。

您可以透過兩種方式指定存取限制:

動作標記範本

如果內容含有多個深層連結,Action 標記物件就會包含多個目標物件。舉例來說,iOS 版內容的深層連結可能與 Android 版不同。此外,如果根據地區和時間範圍設有不同的存取限制,Action Markup 物件可以有多個 Action 存取規格物件或優惠物件,如以下範本所示。

適用於 Watch Action 的動作標記物件範本:

"potentialAction": {
  "@type": "WatchAction",
  "target": [
    { <TARGET OBJECT 01> },
    { <TARGET OBJECT 02> }
  ],
  "actionAccessibilityRequirement": [
    { <ACTION ACCESSIBILITY OBJECT 01> },
    { <ACTION ACCESSIBILITY OBJECT 02> }
  ]
}

Listen Actions 的動作標記物件範本:

"potentialAction": {
  "@type": "ListenAction",
  "target": [
    { <TARGET OBJECT 01> },
    { <TARGET OBJECT 02> }
  ],
  "expectsAcceptanceOf": [
    { <OFFER OBJECT 01> },
    { <OFFER OBJECT 02> }
  ]
}

目標

目標物件會將深層連結對應至各種 Google 平台。這個物件是 動作標記物件的屬性 (target)。

目標範例

如果內容含有根據平台建立的多個深層連結,請建立多個目標物件,以提供不同的對應項目。舉例來說,內容的 Chromecast 深層連結可能與其他平台的深層連結不同,如以下範例所示。

目標物件 (基本) 範例:

"target": {
  "@type": "EntryPoint",
  "urlTemplate": "http://www.example.com/my_favorite_movie?autoplay=true",
  "actionPlatform": [
    "http://schema.org/DesktopWebPlatform",
    "http://schema.org/MobileWebPlatform",
    "http://schema.org/AndroidPlatform",
    "http://schema.org/AndroidTVPlatform",
    "http://schema.org/IOSPlatform",
    "http://schema.googleapis.com/GoogleVideoCast"
  ]
}

含有兩個深層連結的目標物件範例:

"target": [
  {
    "@type": "EntryPoint",
    "urlTemplate": "http://www.example.com/my_favorite_movie?autoplay=true",
    "actionPlatform": [
      "http://schema.org/DesktopWebPlatform",
      "http://schema.org/MobileWebPlatform",
      "http://schema.org/AndroidPlatform",
      "http://schema.org/AndroidTVPlatform",
      "http://schema.org/IOSPlatform"
    ]
  },
  {
    "@type": "EntryPoint",
    "urlTemplate": "http://www.example.com/cast/my_favorite_movie?autoplay=true",
    "actionPlatform": [
      "http://schema.googleapis.com/GoogleVideoCast"
    ]
  }
]

動作存取規格

動作存取權規格物件會根據地區和時間範圍,說明內容的存取權需求。該物件是 Action Markup 物件的屬性 actionAccessibilityRequirement

物件的 category 可以是下列任一選項:

媒體訂閱

媒體訂閱物件會說明內容所需的訂閱項目詳細資料。這個物件是 Action 存取規格物件的屬性 requiresSubscription。如果 actionAccessibilityRequirement.categorysubscriptionexternalSubscription,且訂閱方案包含多個套裝方案或等級,或支援加購項目,則必須提供這項屬性。如果訂閱方案是單層,且可存取目錄中的所有內容,請勿納入這項資訊。

媒體訂閱範例

媒體訂閱物件範例:

"requiresSubscription": {
  "@type": "MediaSubscription",
  "@id": "http://www.example.com/premium_subscription",
  "name": "Example Premium",
  "sameAs": "http://www.example.com/premium_subscription"
}

優惠

優惠物件會說明與內容相關的價格。該物件是下列物件的屬性 (expectsAcceptanceOf):

優惠範例

Watch 動作會在 動作存取權規格物件中指定 expectsAcceptanceOf 屬性:

"potentialAction":{
  "@type":"WatchAction",
  "target":{
    "@type":"EntryPoint",
    "urlTemplate":"http://www.example.com/my_favorite_movie?autoplay=true",
    "actionPlatform":[ "http://schema.org/DesktopWebPlatform" ]
  },
  "actionAccessibilityRequirement": {
    "@type": "ActionAccessSpecification",
    "category": "purchase",
    "availabilityStarts": "2019-01-01T00:00Z",
    "availabilityEnds": "2019-12-31T00:00Z",
    "eligibleRegion": {
      "@type": "Country",
      "name": "US"
    },
    "expectsAcceptanceOf": {
      "@type": "Offer",
      "price": 7.99,
      "priceCurrency": "USD",
      "seller": {
        "@type": "Organization",
        "name": "My example seller"
      }
    }
  }
}

Listen 動作會直接在 Action 標記物件中指定 expectsAcceptanceOf 屬性:

"potentialAction":{
  "@type":"ListenAction",
  "target":{
    "@type":"EntryPoint",
    "urlTemplate":"http://www.example.com/playlist/top_pop_songs?autoplay=true",
    "actionPlatform":[ "http://schema.org/DesktopWebPlatform" ]
  },
  "expectsAcceptanceOf":{
    "@type": "Offer",
    "eligibleRegion": {
      "@type":"Country",
      "name":"US"
    },
    "category": "subscription",
    "name": "Example Music",
    "price": 9.99,
    "priceCurrency": "USD",
    "seller": {
      "@type": "Organization",
      "name": "My example seller",
      "sameAs": "http://www.example.com"
    }
  }
}

圖片

圖片物件會描述與內容相關聯的圖片。

圖片規定如下:

  • 針對 Watch 動作,請提供解析度為 2:3 的高解析度圖片 (至少 140 x 210 像素)。
    • 圖片必須為 .jpg.png 格式。
  • 針對 Listen 動作,請提供 1x1 長寬比的高解析度圖片 (至少 300x300 像素)。
    • 建議使用 600 x 600 像素或更大的尺寸。
    • 圖片必須採 .jpg.png.gif 格式。
  • 圖片網址必須可供檢索和建立索引
  • 您必須擁有使用圖片的權利,並允許圖片在 Google 裝置和資源中顯示。
  • 圖片不得包含下列內容:
    • 模糊、像素化、旋轉或品質不佳的圖片。
    • 未經授權或圖庫相片。
    • 裸露。
    • 非法內容。
  • 更新 MusicPlaylist 時,請更新圖片,以反映新的內容。

圖片示例

"image": {
  "@type": "ImageObject",
  "contentUrl" : "http://www.example.com/artist/my_favorite_artist/1x1/photo1.jpg",
  "dateModified" : "2019-01-05T22:11:33+00:00",
  "regionsAllowed" : ["US","UK","MX"]
}

動態饋給範例

以下範例顯示 Watch 動作和 Listen 動作之間的動態消息結構差異。

觀看動作範例

{
  "@context": "http://schema.org",
  "@type": "DataFeed",
  "dateModified": "2018-07-20T00:44:51Z",
  "dataFeedElement": [
    {
      "@context": ["http://schema.org", {"@language": "en"}],
      "@type": "Movie",
      "@id": "http://www.example.com/my_favorite_movie",
      "url": "http://www.example.com/my_favorite_movie",
      "name": "My Favorite Movie",
      "potentialAction": {
        "@type": "WatchAction",
        "target": {
          "@type": "EntryPoint",
          "urlTemplate": "http://www.example.com/my_favorite_movie?autoplay=true",
          "inLanguage": "en",
          "actionPlatform": [
            "http://schema.org/DesktopWebPlatform",
            "http://schema.org/MobileWebPlatform",
            "http://schema.org/AndroidPlatform",
            "http://schema.org/AndroidTVPlatform",
            "http://schema.org/IOSPlatform",
            "http://schema.googleapis.com/GoogleVideoCast"
          ]
        },
         "actionAccessibilityRequirement": {
           "@type": "ActionAccessSpecification",
           "category": "subscription",
           "availabilityStarts": "2018-07-21T10:35:29Z",
           "availabilityEnds": "2019-10-21T10:35:29Z",
           "eligibleRegion": [
             {
                "@type": "Country",
                "name": "US"
             },
             {
                "@type": "Country",
                "name": "CA"
             }
           ],
        }
      },
      "sameAs": "https://en.wikipedia.org/wiki/my_favorite_movie",
      "releasedEvent": {
        "@type": "PublicationEvent",
        "startDate": "2008-01-20",
        "location": {
          "@type": "Country",
          "name": "US"
        }
      },
      "description": "This is my favorite movie.",
      "actor": [
        {
          "@type": "Person",
          "name": "John Doe",
          "sameAs": "https://en.wikipedia.org/wiki/John_Doe"
        },
        {
          "@type": "Person",
          "name": "Jane Doe",
          "sameAs": "https://en.wikipedia.org/wiki/Jane_Doe"
        }
      ],
      "identifier": [
        {
          "@type": "PropertyValue",
          "propertyID": "IMDB_ID",
          "value":  "tt0123456"
        }
      ]
    }
  ]
}

收聽動作範例

{
  "@context": "http://schema.org",
  "@type": "DataFeed",
  "dateModified": "2018-07-20T00:44:51Z",
  "dataFeedElement": [
    {
      "@context":"http://schema.googleapis.com/",
      "@type":"MusicGroup",
      "@id":"http://www.example.com/artist/my_favorite_artist/",
      "url":"http://www.example.com/artist/my_favorite_artist/",
      "name":"My Favorite Artist",
      "sameAs":"https://en.wikipedia.org/wiki/my_favorite_artist",
      "description":"This is my favorite pop music artist.",
      "potentialAction": {
        "@type":"ListenAction",
        "target": {
          "@type":"EntryPoint",
          "urlTemplate":"http://www.example.com/artist/my_favorite_artist?autoplay=true",
          "actionPlatform":[
            "http://schema.org/DesktopWebPlatform",
            "http://schema.org/IOSPlatform",
            "http://schema.org/AndroidPlatform",
            "http://schema.org/AndroidTVPlatform",
            "http://schema.googleapis.com/GoogleAudioCast",
            "http://schema.googleapis.com/GoogleVideoCast"
          ]
        },
        "expectsAcceptanceOf":{
          "@type":"Offer",
          "category":"subscription",
          "eligibleRegion": {
            "@type":"Country",
            "name":"US"
          },
          "price": 8.99,
          "priceCurrency": "USD"
        }
      },
      "subjectOf": {
        "@type":"MusicPlaylist",
        "@id":"http://www.example.com/artist_mix/my_favorite_artist/",
        "url":"http://www.example.com/artist_mix/my_favorite_artist/",
        "name":"My Favorite Artist Mix",
        "description":"A mix of music similar to My Favorite Artist",
        "potentialAction":{
          "@type":"ListenAction",
          "target": {
            "@type":"EntryPoint",
            "urlTemplate":"http://www.example.com/artist_mix/my_favorite_artist?autoplay=true",
            "actionPlatform":[
              "http://schema.org/DesktopWebPlatform",
              "http://schema.org/IOSPlatform",
              "http://schema.org/AndroidPlatform",
              "http://schema.org/AndroidTVPlatform",
              "http://schema.googleapis.com/GoogleAudioCast",
              "http://schema.googleapis.com/GoogleVideoCast"
            ]
          },
          "expectsAcceptanceOf":{
            "@type":"Offer",
            "category":"free",
            "eligibleRegion": {
              "@type":"Country",
              "name":"US"
            }
          }
        }
      }
    }
  ]
}