如何在YouTube上分享我的网站上的视频,如YouTube [英] how to share a video from my website on facebook like youtube

查看:739
本文介绍了如何在YouTube上分享我的网站上的视频,如YouTube的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个拥有HTML5视频播放器的网站。



我想分享链接(例如: http://site.com/video/example-2 ),用户点击Facebook上的该帖子的图片,开始播放视频。 / p>

就像YouTube视频和vimeo视频一样。



我该怎么做?



谢谢

解决方案


我有一个拥有HTML5视频的网站播放器。


您想要找到一个好的SWF(* .SWF)视频播放器,可以从 url = {video_Hot_link} (pass URL 参数到 SWF player)



现在,当您的SWF播放器准备好流式传输时,一些视频添加了 Facebook Open Graph
到您的< head> 标签,如下所示:

 < meta property = og:typecontent =video> <! - 网站/网页类型更多信息http://ogp.me/  - > 
< meta property =og:video:typecontent =application / x-shockwave-flash> <! - 你需要这个,因为你的播放器是一个SWF播放器 - >
< meta property =og:video:widthcontent =像素宽度> <! - 播放器宽度>>
< meta property =og:video:heightcontent =像素高度> <! - player height - >
< meta property =og:videocontent =http://example.com/{path_to}/{swf_player}.swf?url={video_soure}> <! - 您将需要使用服务器端代码回显/打印视频源(* .mp4)>
< meta property =og:video:secure_urlcontent =https://example.com/{path_to}/{swf_player}.swf?url={video_soure}> <! - 对于使用SSL的用户(实际上Facebook强制所有人使用SSL,因此您需要使用og:video:secure_url)的用户才需要使用 - >

此外,您需要将以下前缀添加到< html> / code> likeso

 < html prefix =og:http://ogp.me/ns# > 


I have a website that has a HTML5 video player.

I want to share the link ( ex: http://site.com/video/example-2 ) on facebook and one the users click on the image of that post on the facebook it starts playing the video there.

Just like youtube videos and vimeo videos.

How can I do that?

Thanks

解决方案

I have a website that has a HTML5 video player.

You want to find a good SWF (*.SWF) video player that can stream video from url={video_Hot_link} (pass URL parameter to the SWF player)

Now after you got your SWF player ready for streaming some videos add Facebook Open Graph to your <head> tag like below:

<meta property="og:type" content="video"> <!-- site/page type more information http://ogp.me/ -->
<meta property="og:video:type" content="application/x-shockwave-flash"> <!-- you need this because your player is a SWF player -->
<meta property="og:video:width" content="Width in Pixels"> <!-- player width -->
<meta property="og:video:height" content="Height in Pixels"> <!-- player height -->
<meta property="og:video" content="http://example.com/{path_to}/{swf_player}.swf?url={video_soure}"> <!-- You will need to echo/print the video source (*.mp4) with server-side code -->
<meta property="og:video:secure_url" content="https://example.com/{path_to}/{swf_player}.swf?url={video_soure}"> <!-- required for users whom use SSL (actually Facebook forces everyone to use SSL so you're required to use og:video:secure_url) so get a one -->

Additionally, you need to add the following prefix to <html> likeso

<html prefix="og: http://ogp.me/ns#">

这篇关于如何在YouTube上分享我的网站上的视频,如YouTube的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆