繁体   English   中英

Facebook通过应用发布瑞士法郎

[英]Facebook posting swf via app

我有点卡住了。

我有一个Joomla网站,我的应用程序可以正常工作,任何应用程序用户都可以使用FBui将视频发布到某些页面上,但是我真正想要的是能够将视频发布到任何地方的功能,使用og标签,我已经添加了它们,但视频却没有显示-我猜我在某处出现问题或冲突。 示例页面:

相册页面-http://fnoob.com/archives/P/34-alex-paterson/468-chewy-choosedays-vol-91-100

这是相关的标题部分(我已经删除了链接+ appid-我知道它们可以工作):

    <html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns="http://www.w3.org/1999/xhtml" xmlns:og="http://ogp.me/ns#" xml:lang="en-gb" lang="en-gb" slick-uniqueid="3">
<head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# video: http://ogp.me/ns/video#"><meta property="fb:app_id" content="my_app_id">
        <meta property="og:type" content="video.other" >
        <meta property="og:url" content="path_to_swf" >
        <meta property="og:image" content="path_to_image" >

再往下,我们有贴墙功能,其作用是:

<div id='fb-root'></div>
                <script> 
                var APP_ID='137867843030139';

                window.fbAsyncInit = initFacebook;

                function initFacebook()
                {
                    FB.init({
                        appId  : APP_ID,
                        status : true, // check login status
                        cookie : false, // enable cookies to allow the server to access the session
                        xfbml  : true  // parse XFBML
                        });

                FB.getLoginStatus(onFacebookLoginStatus);
                };

                (function() {
                var e = document.createElement('script');
                e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js';
                e.async = true;
                document.getElementById('fb-root').appendChild(e);

                }());



    function facebookLogout()
    {
        FB.logout();
        var loginButtonDiv=document.getElementById("fb-login-button-div");
        loginButtonDiv.style.display="block";   
        var logoutButtonDiv=document.getElementById("fb-logout-button-div");
        logoutButtonDiv.style.display="none";   
        var contentDiv=document.getElementById("user-is-authenticated-div");
        contentDiv.style.display="none";            
    }

    function facebookLogin()
    {
        var loginUrl='http://www.facebook.com/dialog/oauth/?'+
            'scope=publish_stream,manage_pages&'+
            'client_id='+APP_ID+'&'+
            'redirect_uri='+document.location.href+'&'+
            'response_type=token';      
        window.location=loginUrl;
    }

    /*
    * Callback function for FB.login
    */

    function onFacebookLoginStatus(response)
    {
        if (response.status=='connected' && response.authResponse)
        {
            var loginButtonDiv=document.getElementById("fb-login-button-div");
            loginButtonDiv.style.display="none";
            var logoutButtonDiv=document.getElementById("fb-logout-button-div");
            logoutButtonDiv.style.display="none";
            var contentDiv=document.getElementById("user-is-authenticated-div");
            contentDiv.style.display="block";

        }
        else
        {
            var loginButtonDiv=document.getElementById("fb-login-button-div");
            loginButtonDiv.style.display="block";   
            var contentDiv=document.getElementById("user-is-authenticated-div");
            contentDiv.style.display="none";            
        }

    }  





    function postToWallUsingFBUi()
    {   
        var data=
        {
            method: 'feed',  
            message: '',
            display: 'iframe',
            caption: '<? echo $this->album->artist_name; ?> Click to Listen',
            name: '<? echo $this->album->name; ?>',
            picture: 'http://fnoob.com/images/albums/<? echo $this->album->image; ?>',   
            source: link_to_file',  
            link: '<? echo $album_link ?>',  // Go here if user click the picture
            description: 'By artist  <? echo $this->album->artist_name; ?> on <? echo $this->album->format_name; ?> and powered by FNOOB.com ',
            actions: [{ name: 'fnoob.com', link: '<? echo $album_link ?>' }],           
        }
        FB.ui(data, onPostToWallCompleted);
    }

    function onPostToWallCompleted(response)
    {
        if (response)
        {
            //console.log(response);
            if (response.error)
            {
                alert(response.error.message);
            }
            else
            {
                if (response.id)
                    alert('Posted.... carry on!');                      
                else if (response.post_id)
                    alert('Posted.... carry on!');
                else
                    alert('Crap... something went wrong');
            }
        }
        // user cancelled
    }

    </script>

因此,我基本上想要的是基本上每次在Facebook上共享此页面(页面,提要等)时,图像和视频就会加载,并且如果单击它会播放并链接到网站上的页面。 对此,任何帮助都非常感激-一直在设法解决这一问题。

添加此标签

<meta property="og:video:width" content="640" />
<meta property="og:video:height" content="360" />
<meta property="og:video:type" content="application/x-shockwave-flash" />
<meta property="og:video" content="DIRECT_VIDEO_FILE_URL" />
<meta property="og:video:secure_url" content="DIRECT_VIDEO_FILE_URL_SSL" /> 
<meta property="og:image" content="Image_you_want_to_use_as_thumbnail" /> 
<meta property="og:image:secure_url" content="Image_you_want_to_use_as_thumbnail_SSL" />

视频文件将以mp4和swf格式工作。
使此功能起作用的重要部分是您从SSL / HTTPS源传递文件

图像将是播放按钮后面的缩略图

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM