在Facebook墙上分享HTML5播放器 [英] Share HTML5 player on Facebook wall

查看:96
本文介绍了在Facebook墙上分享HTML5播放器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个播放器在Flash中也是一样的HTML5版本。我通过iframe调用一个页面来检测浏览器和设备,并相应地加载播放器,并且它的工作正常。



在HTML5版本的播放器之前,我能够将Flash播放器分享到Facebook。但是我们如何使其可以与HTML5播放器一起工作?如果我共享iframe页面,它不起作用,也不会播放视频。



我发现youtube能够做同样的事情,请咨询并帮助如何完成要求。

解决方案

开放图表文档页面



您将需要在文档中给出的资源页面中添加以下打开的图形标签。

 < html xmlns:og =http://ogp.me/ns#> 
< head>
...
[必填标签]
< meta property =og:videocontent =http://example.com/awesome.swf/>
< meta property =og:video:heightcontent =640/>
< meta property =og:video:widthcontent =385/>
< meta property =og:video:typecontent =application / x-shockwave-flash/>
< meta property =og:video:secure_url
content =https://secure.example.com/awesome.swf/>
< meta property =og:videocontent =http://example.com/html5.mp4/>
< meta property =og:video:typecontent =video / mp4/>
< meta property =og:videocontent =http://example.com/fallback.vid/>
< meta property =og:video:typecontent =text / html/>
...
< / head>


I have a player both in Flash as well the same in HTML5 version. I am calling a page through iframe which detects the browser and device and loads the player accordingly and it is working fine.

Before the HTML5 version of the player I was able to share the Flash player to Facebook. But how do we make it workable with HTML5 player? If I share the iframe page it doesn't work nor the video doesn't play.

I find that youtube is able to do the same what we require, please advice and help how to accomplish the requirements.

解决方案

Check the section corresponding to audio and video data on the open graph documentation page.

You will need to add the following open graph tags to the resource page as given in the documentation.

<html xmlns:og="http://ogp.me/ns#"> 
    <head>
        ...
        [REQUIRED TAGS]
        <meta property="og:video" content="http://example.com/awesome.swf" />
        <meta property="og:video:height" content="640" />
        <meta property="og:video:width" content="385" />
        <meta property="og:video:type" content="application/x-shockwave-flash" />
        <meta property="og:video:secure_url" 
              content="https://secure.example.com/awesome.swf" />
        <meta property="og:video" content="http://example.com/html5.mp4" />
        <meta property="og:video:type" content="video/mp4" />
        <meta property="og:video" content="http://example.com/fallback.vid" />
        <meta property="og:video:type" content="text/html" />
        ...
    </head>

这篇关于在Facebook墙上分享HTML5播放器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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