分享 link 时显示 video-thumbnail 而不是静态图片
Show video-thumbnail instead of static image when sharing a link
在我的网站上,我有一些 OpenGraph 元数据,因此我可以自定义缩略图、标题和描述,以便在社交网络或消息传递应用程序中共享时:
<meta property="og:title" content="Title" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://mypage.com" />
<meta property="og:image" content="http://mypage.com/path/to/thumb.png" />
<meta property="og:description" content="Description of my page" />
前几天,我在 iOS 上通过 Messages/iMessage 发送消息,我发现一些共享的 link s(不是来自我的站点)播放静音视频而不是静态图像作为缩略图(它似乎发生在 iOS 10 之后)。这是来自亚马逊 link:
的示例
有没有办法指定应用程序应该使用视频而不是使用静态图像作为缩略图?使用 OpenGraph 标签或不同的系统。我试过使用这个,但它似乎不起作用:
<meta property="og:video" content="http://mypage.com/path/to/video.mp4" />
此外,我无法在不同于 iMessage 的消息传递系统中复制这种效果(我尝试使用 Google Chat、Skype、WhatsApp、GMail...)而且我只看到了当它是亚马逊时的视频 link,但查看源代码我没有看到任何表明应该拍摄视频或哪个视频(有几个,iMessage 选择了第一个),我没有'网上查不到相关资料。也许它只适用于苹果和亚马逊,我想知道是否任何网站都可以使用它。
我使用了正确的标签 (og:video
),但问题是视频的文件大小。
根据 Apple 的 "Best Practices for Link Previews in Messages" Technical Note,og:video
或 twitter:player:stream
都可以将视频预览添加到消息中(强调我的):
Videos in link previews
- Putting a direct link to your video asset in the Open Graph metadata is better than referencing an embeddable video page. With the direct link to video, Messages will load and display fast, and use the system user interface for video playback.
- If the link preview machinery encounters a
og:video
or twitter:player:stream
that points to a downloadable single media asset (for example, an MPEG-4 file) that can be played, it will attempt to download the video and automatically play it back.
- Video that can be streamed but not downloaded (such as HTTP Live Streams or QuickTime Reference Movies) will still play inline, but require the user to tap to start playback. Video that requires embedding HTML or plug-ins will not play inline.
在页面底部,指定链接媒体有一些限制,特别是我没有遵循的每个资源 1MB 的限制(强调我的):
Limits
- All limits are subject to change at any point in time; use these only as guidelines.
- Icons should be square, and at least 108px per side.
- Images should be at least 900px in width.
- Images less than 150px in width will not be used, or may be presented as icons.
- The main resource located at the link is limited to 1MB. The total size of sub-resources (the icons, images, and videos which are selected as most interesting) is limited to 10MB.
在我的网站上,我有一些 OpenGraph 元数据,因此我可以自定义缩略图、标题和描述,以便在社交网络或消息传递应用程序中共享时:
<meta property="og:title" content="Title" />
<meta property="og:type" content="website" />
<meta property="og:url" content="http://mypage.com" />
<meta property="og:image" content="http://mypage.com/path/to/thumb.png" />
<meta property="og:description" content="Description of my page" />
前几天,我在 iOS 上通过 Messages/iMessage 发送消息,我发现一些共享的 link s(不是来自我的站点)播放静音视频而不是静态图像作为缩略图(它似乎发生在 iOS 10 之后)。这是来自亚马逊 link:
的示例有没有办法指定应用程序应该使用视频而不是使用静态图像作为缩略图?使用 OpenGraph 标签或不同的系统。我试过使用这个,但它似乎不起作用:
<meta property="og:video" content="http://mypage.com/path/to/video.mp4" />
此外,我无法在不同于 iMessage 的消息传递系统中复制这种效果(我尝试使用 Google Chat、Skype、WhatsApp、GMail...)而且我只看到了当它是亚马逊时的视频 link,但查看源代码我没有看到任何表明应该拍摄视频或哪个视频(有几个,iMessage 选择了第一个),我没有'网上查不到相关资料。也许它只适用于苹果和亚马逊,我想知道是否任何网站都可以使用它。
我使用了正确的标签 (og:video
),但问题是视频的文件大小。
根据 Apple 的 "Best Practices for Link Previews in Messages" Technical Note,og:video
或 twitter:player:stream
都可以将视频预览添加到消息中(强调我的):
Videos in link previews
- Putting a direct link to your video asset in the Open Graph metadata is better than referencing an embeddable video page. With the direct link to video, Messages will load and display fast, and use the system user interface for video playback.
- If the link preview machinery encounters a
og:video
ortwitter:player:stream
that points to a downloadable single media asset (for example, an MPEG-4 file) that can be played, it will attempt to download the video and automatically play it back.- Video that can be streamed but not downloaded (such as HTTP Live Streams or QuickTime Reference Movies) will still play inline, but require the user to tap to start playback. Video that requires embedding HTML or plug-ins will not play inline.
在页面底部,指定链接媒体有一些限制,特别是我没有遵循的每个资源 1MB 的限制(强调我的):
Limits
- All limits are subject to change at any point in time; use these only as guidelines.
- Icons should be square, and at least 108px per side.
- Images should be at least 900px in width.
- Images less than 150px in width will not be used, or may be presented as icons.
- The main resource located at the link is limited to 1MB. The total size of sub-resources (the icons, images, and videos which are selected as most interesting) is limited to 10MB.