将 RSS 源映射到 Windows Media 设备管理器 属性

Windows 媒体播放器 11 提供了 RSS 聚合器功能,使用户能够在其计算机上存储从播客获取的内容。 本主题介绍在 RSS 源中找到的 XML 元素。 此外,它还将这些 RSS 元素映射到 Windows Media 设备管理器 属性。

RSS 源中的元素具有以下层次结构和属性:

<channel>
    <title />
    <link />
    <description />
    <language />
    <copyright />
    <managingEditor />
    <webMaster />
    <pubDate />
    <lastBuildDate />
    <category />
    <generator />
    <docs />
    <cloud />
    <ttl />

    <image>
        <url />
        <title />
        <link />
        <width />
        <height />
        <description />
    </image>

    <rating />

    <textInput>
        <title />
        <description />
        <name />
        <link />
    </textInput>

    <skipHours />
    <skipDays />

    <item>
        <title />
        <link />
        <description />
        <author />
        <category domain = " "/>
        <comments />
        <enclousure url = " " length = " " type = " "/>
        <guid isPermaLink = " "/>
        <pubDate />
        <source url = " " />
    </item>
</channel>

下表列出了 RSS 源中的通道元素以及相应的 Windows Media 设备管理器属性。

Channel 元素 状态 相应的 Windows Media 设备管理器 属性
category 可选 g_wszWMDMGenre
cloud 不适用 不适用
copyright 可选 g_wszWMDMProviderCopyright
description 必需 g_wszWMDMDescription
文档 不适用 不适用
生成器 (generator) 不适用 不适用
语言 不适用 不适用
lastBuildDate 可选 g_wszWMDMLastModifiedDate
链接 必选 g_wszWMDMDestinationURL
managingEditor 可选 g_wszWMDMEditor
pubDate 可选 g_wszWMDMYear
rating 不适用 不适用
skipDays 不适用 不适用
skipHours 不适用 不适用
textInput 不适用 不适用
title 必选 g_wszWMDMTitle
ttl 可选 g_wszWMDMTimeToLive
站长 可选 g_wszWMDMWebMaster

 

下表列出了 RSS 源中的图像元素和相应的 WMDM 属性。

Image 元素 状态 相应的 Windows Media 设备管理器 属性
description 可选 g_wszWMDMDescription
高度 可选 g_wszWMDMHeight
链接 可选 g_wszWMDMDestinationURL
title 可选 g_wszWMDMTitle
url 可选 g_wszWMDMSourceURL
width 可选 g_wszWMDMWidth

 

下表列出了 RSS 源中的项元素以及相应的 Windows Media 设备管理器属性。

Item 元素 Attribute 状态 相应的 Windows Media 设备管理器 属性
author 可选 g_wszWMDMAuthor
category 可选 g_wszWMDMGenre
不适用 不适用
description 可选 g_wszWMDMDescription
外壳 可选 不适用
length 必选 g_wszWMDMFileSize
type 必选 (MIME 类型应映射到属性内容类型。)
url 必选 g_wszWMDMSourceURL
guid 可选 g_wszWMDMediaGuid
isPermaLink 不适用 不适用
链接 可选 g_wszWMDMDestinationURL
pubDate 可选 g_wszWMDMYear
source 不适用 不适用
title 可选 g_wszWMDMTitle

 

示例

以下示例显示了由出版公司的 CEO 提供的虚构播客的完整 RSS 源。

<channel>
    <title>The Digital Publication</title>
    <link>https://www.lucernepublishing.com/podcasting</link>
    <description>Lucerne Publishing CEO Peter Bankov takes a look at the latest trends in online publications.</description>
    <language>en-us</language>
    <copyright>2006 Lucerne Publishing LP, LLLP. All Rights Reserved.</copyright>
    <managingEditor>someone@example.com</managingEditor>
    <webMaster>someone@example.com</webMaster>
    <pubDate>Fri, 9 June 2006 14:00:28 EDT</pubDate>
    <lastBuildDate Fri, 9 June 2006 14:00:28 EDT />
    <category>News</category>
    <generator>Podcaster version 1.0</generator>
    <docs>https://www.lucernepublishing.com/tech/rss</docs>
    <cloud />
    <ttl>240</ttl>
    <rating />
    <textInput />
    <skipHours />
    <skipDays />

<image>
     <url>https://www.lucernepublishing.com/images/logo.gif</url>
     <title>Lucerne Publishing</title>
     <link>https://www.lucernepublishing.com/community/podcasts</link>
     <width>300</width>
     <height>300</height>
     <description>Lucerne Logo</description>
</image>

<item>
    <title>The Digital Publication</title>
    <link>https://www.lucernepublishing/services/podcasting/digital.publishing/audio/2006/06/digital0601.mp3</link>
    <description>Online publications are rapidly changing. A publishing house CEO examines the trends of the past five years and their implications.</description>
    <author>Lucerne</author>
    <category>News</category>
    <comments />
    <enclosure url="https://www.lucernepublishing/services/podcasting/digital.publishing/audio/2006/06/digital0601.mp3" length="10329011" type="audio/mpeg" />
    <guid>https://www.lucernepublishing/services/podcasting/digital.publishing/audio/2006/06/digital0601.mp3</guid>
    <pubDate>Thur, 1 June 2006 14:00:28 EDT</pubDate>
    <source />
</item>

</channel>

RSS 通道元素到 Windows Media 设备管理器 属性值的映射

下表介绍了上一示例中 RSS Channel 元素中的值如何映射到特定的 Windows Media 设备管理器属性。

Windows Media 设备管理器 属性
g_wszWMDMAuthorDate 星期五, 9 六月 2006 14:00:28 EDT
g_wszWMDMDESCRIPTION 卢塞恩出版公司首席执行官彼得·班科夫查看了在线出版物的最新趋势。
g_wszWMDMDESTINATION_URL https://www.lucernepublishing/services/podcasting
g_wszWMDMEDITOR someone@example.com
g_wszWMDMFileCreationDate 星期五, 9 六月 2006 14:00:28 EDT
g_wszWMDMFileName 数字出版物
g_wszWMDMFileSize 13,790
g_wszWMDMFormatCode WMDM_FORMATCODE_MEDIA_CAST
g_wszWMDMGENRE 新闻
g_wszWMDMLAST_MODIFIED_DATE 星期五, 9 六月 2006 14:00:28 EDT
g_wszWMDMLastModifiedDate 星期五, 9 六月 2006 14:00:28 EDT
g_wszWMDMProviderCopyright 2006 Lucerne Publishing LP, LLLP. 保留所有权利。
g_wszWMDMTimeToLive 240
g_wszWMDMTitle 数字出版物
g_wszWMDMWEBMASTER someone@example.com
g_wszWMDMYear 星期五, 9 六月 2006 14:00:28 EDT

 

将 RSS 图像元素映射到 Windows Media 设备管理器 属性值

下表描述了上一示例中 RSS Image 元素中的值如何映射到特定 Windows Media 设备管理器属性。

Windows Media 设备管理器 属性
g_wszWMDMAlbumCoverFormat WPD_OBJECT_FORMAT_GIF
g_wszWMDMAlbumCoverSize 512
g_wszWMDMDescription Lucerne 徽标
g_wszWMDMDestinationURL www.lucernepublishing.com/community/podcasts
g_wszWMDMHeight 300
g_wszWMDMSourceURL https://www.lucernepublishing.com/images/logo.gif
g_wszWMDMTitle Lucerne Publishing
g_wszWMDMWidth 300

 

将 RSS 项元素映射到 Windows Media 设备管理器 属性值

下表描述了上一示例中 RSS 项元素中的值如何映射到特定 Windows Media 设备管理器属性。

Windows Media 设备管理器 属性
g_wszWMDMAuthor 苜蓿
g_wszWMDMAuthorDate 星期四, 1 六月 2006 14:00:28 EDT
g_wszWMDMDescription 联机出版物正在迅速变化。 一位出版社首席执行官研究了过去五年的趋势及其影响。
g_wszWMDMDestinationURL https://www.lucernepublishing/services/podcasting/digital.publishing/audio/2006/06/digital0601.mp3
g_wszWMDMDuration 120325445
g_wszWMDMFileCreationDate 星期四, 1 六月 2006 14:00:28 EDT
g_wszWMDMFileSize 10329011
g_wszWMDMFormatCode WMDM_FORMATCODE_MP3
g_wszWMDMGenre 新闻
g_wszWMDMLastModifiedDate 星期四, 1 六月 2006 14:00:28 EDT
g_wszWMDMMediaGuid https://www.lucernepublishing/services/podcasting/digital.publishing/audio/2006/06/digital0601.mp3
g_wszWMDMSourceURL https://www.lucernepublishing/services/podcasting/digital.publishing/audio/2006/06/digital0601.mp3
g_wszWMDMTitle 数字出版物
g_wszWMDMYear 星期四, 1 六月 2006 14:00:28 EDT

 

元数据常量