用Facebook-SDK发布的视频无法在iPhone facebook应用中播放 [英] video published with Facebook-SDK not playing in iPhone facebook app

查看:113
本文介绍了用Facebook-SDK发布的视频无法在iPhone facebook应用中播放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个iPhone应用程序,可让用户在自己的Facebook墙上张贴故事".这个故事包含一个youtube视频作为消息的一部分.该视频可以从标准的Web浏览器Facebook客户端正常加载和播放,但无法从iphone facebook应用加载.当用户从iPhone facebook应用程序选择视频链接时,空白的白色视图将被推到导航控制器视图堆栈中.有没有一种方法可以获取链接以触发iOS来加载youtube应用?

I have an iphone app that lets users post a 'story' to their facebook wall. This story contains a youtube video as part of the message. The video loads and plays normally from the standard web-browser facebook client, but fails to load from the iphone facebook app. When the user selects the video link from the iPhone facebook app a blank white view is pushed onto the navigation controller view-stack. Is there a way to get the link to trigger the iOS to load the youtube app?

SBJSON *jsonWriter = [[SBJSON new] autorelease];

        NSDictionary* actionLinks = [NSArray arrayWithObjects:[NSDictionary dictionaryWithObjectsAndKeys: 
                                                               @"#####",@"text",
                                                               @"http://www.facebook.com/#####",@"href",
                                                               nil], nil];

        NSString *actionLinksStr = [jsonWriter stringWithObject:actionLinks];

        NSString *video_link = @"http://www.youtube.com/v/#####";
        NSString *image_link = @"http://i.ytimg.com/vi/#####/2.jpg";

        NSDictionary *video_share = [NSDictionary dictionaryWithObjectsAndKeys:
                                     @"flash",      @"type",
                                     video_link,    @"swfsrc",
                                     image_link,    @"imgsrc",
                                     @"100",        @"width",
                                     @"80",         @"height",
                                     @"400",        @"expanded_width",
                                     @"320",        @"expanded_height",
                                     nil];

        NSString *caption = @"#####";
        NSString *description = @"";
        NSString *name = @"#####";
        NSString *url = @"http://www.#####.com/";

        NSDictionary* attachment = [NSDictionary dictionaryWithObjectsAndKeys:
                                    name, @"name",
                                    caption, @"caption",
                                    description, @"description",
                                    [NSArray arrayWithObjects:video_share,nil], @"media",
                                    url, @"href", nil];

        NSString *attachmentStr = [jsonWriter stringWithObject:attachment];

        NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       kFBAppId, @"api_key",
                                       @"#####",  @"user_message_prompt",
                                       actionLinksStr, @"action_links",
                                       attachmentStr, @"attachment",
                                       nil];

        [facebook dialog: @"stream.publish"
               andParams: params
             andDelegate: self];

推荐答案

如果您正在模拟器上测试并在Webview中打开链接,则将无法播放或加载youtube视频.

if you are testing on simulator and opening link in webview, youtube video will not be play or load.

但是它将在设备i-e iphone/ipad/ipod上播放.

but it will play on device i-e iphone/ipad/ipod.

这篇关于用Facebook-SDK发布的视频无法在iPhone facebook应用中播放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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