首页 \ 问答 \ 如何在Android上分享视频到Facebook(How to share video to Facebook on Android)

如何在Android上分享视频到Facebook(How to share video to Facebook on Android)

我尝试从android集成的Facebook集成中引用

这是我的一步

第1步:尝试导入Facebook SDK

    repositories {
        mavenCentral()
    }

    dependencies {
...
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
...
    }

Step2:在Manifests上设置代码,333991926986699是我的Facebook app_id

<uses-permission android:name="android.permission.INTERNET"/>

<application
....
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>

        <provider android:authorities="com.facebook.app.FacebookContentProvider333991926986699"
            android:name="com.facebook.FacebookContentProvider"
            android:exported="true" />
....
    </application>

然后关于从官方分享视频代码是这样的:

Uri videoFileUri = ...
ShareVideo = new ShareVideo.Builder()
        .setLocalUrl(videoUrl)
        .build();
ShareVideoContent content = new ShareVideoContent.Builder()
        .setVideo(video)
        .build();

我不知道如何让它发挥作用。

这是我的视频链接 。 任何人都可以教我下一步应该做什么?

任何帮助,将不胜感激。

这是我尝试共享代码:

shareButton=(Button)findViewById(R.id.shareButton);

        shareButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Uri videoFileUri=Uri.parse("https://www.youtube.com/watch?v=zeLqNx7dMBM");
                ShareVideo shareVideo=new ShareVideo.Builder()
                        .setLocalUrl(videoFileUri)
                        .build();
                //There is no use by content
                ShareVideoContent content=new ShareVideoContent.Builder()
                        .setVideo(shareVideo)
                        .build();
            }
        });

I try to take a reference from Facebook integration in android

Here is my step

Step1: Try to import Facebook SDK

    repositories {
        mavenCentral()
    }

    dependencies {
...
        compile 'com.android.support.constraint:constraint-layout:1.0.2'
...
    }

Step2: Set the code on Manifests,333991926986699 is My Facebook app_id

<uses-permission android:name="android.permission.INTERNET"/>

<application
....
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook_app_id"/>

        <provider android:authorities="com.facebook.app.FacebookContentProvider333991926986699"
            android:name="com.facebook.FacebookContentProvider"
            android:exported="true" />
....
    </application>

And then about sharing video code from official is like this:

Uri videoFileUri = ...
ShareVideo = new ShareVideo.Builder()
        .setLocalUrl(videoUrl)
        .build();
ShareVideoContent content = new ShareVideoContent.Builder()
        .setVideo(video)
        .build();

I have no idea how to let it work .

This is my video link. Can anyone teach me what next should I do?

Any help would be appreciated.

Here is i try to share code:

shareButton=(Button)findViewById(R.id.shareButton);

        shareButton.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {

                Uri videoFileUri=Uri.parse("https://www.youtube.com/watch?v=zeLqNx7dMBM");
                ShareVideo shareVideo=new ShareVideo.Builder()
                        .setLocalUrl(videoFileUri)
                        .build();
                //There is no use by content
                ShareVideoContent content=new ShareVideoContent.Builder()
                        .setVideo(shareVideo)
                        .build();
            }
        });

原文:https://stackoverflow.com/questions/43336159
更新时间:2023-09-01 19:09

最满意答案

这是github上很棒的图书馆

https://github.com/nicklockwood/ReflectionView


here is great library on github for doing this

https://github.com/nicklockwood/ReflectionView

相关问答

更多
  • 简而言之,镜像允许您让第二台服务器成为主服务器的“热”备份副本,随时准备接管主服务器发生故障的任何时刻。 所以镜像提供故障切换和可靠性。 另一方面,复制允许两台或更多服务器保持“同步” - 这意味着辅助服务器可以回答查询并(取决于设置)实际更改数据(它将在同步中合并)。 您也可以将其用于本地缓存,负载平衡等。 In short, mirroring allows you to have a second server be a "hot" stand-by copy of the main server, ...
  • 检查这些物品: 2。 镜像数据库必须从主体服务器的完全备份创建,并应在“使用Norecovery进行恢复”模型中进行恢复。 紧接着还原主数据库的事务日志备份,以使镜像和主数据库的日志序列号相互同步。 3。 镜像数据库必须与主体数据库具有相同的名称。 ... 8。 数据库镜像可用于企业版,开发人员版和标准版,但请参阅Microsoft网站以获取比较图,因为某些功能在标准版中不可用。 SQL Server Workgroup和Express Editions只能用作见证服务器。 数据库镜像在Microsoft ...
  • 不要忘记AVCapturePreviewLayer本质上是一个核心动画层。 我不确切地知道你想要什么,但是要切换CALayer镜像你可以使用UISwitch并定义它的IBAction来翻转预览层,如下所示: yourPreviewLayer.transform = CATransform3DMakeRotation(M_PI, 0.0f, 1.0f, 0.0f); 这将使您的图层水平翻转180º,提供镜面效果,并为开关关闭位置,它将再旋转180º,取消效果。 祝你好运。 Don't forget ...
  • 有几种类型的复制,当您需要将数据子集从一个服务器发送到另一个服务器时,通常使用事务复制(可能是最常用的形式),例如将数据从生产服务器发送到报告数据库等 来自technet的关于复制的引用: 事务复制通常用于需要高吞吐量的服务器到服务器方案,包括:提高可伸缩性和可用性; 数据仓库和报告; 整合来自多个站点的数据; 整合异构数据; 和卸载批处理。 合并复制主要用于可能存在数据冲突的移动应用程序或分布式服务器应用程序。 常见方案包括:与移动用户交换数据; 消费者销售点(POS)应用程序; 和来自多个站点的数据集成 ...
  • 我已经解决了自己的问题,看起来SQL Server驱动程序无法识别故障转移伙伴,我将连接字符串更改为: Driver={SQL Server Native Client 10.0};Failover_Partner=WCFTEPATSQL02;Server=WCFTEPATSQL01;Database=DBForms;Trusted_Connection=yes;Network=dbmssocn;Pooling=false 一切都很好。 I have solved my own issue, it loo ...
  • 在iOS 7中,可以通过您设置的音频类别确定Airplay选项(如QA1803中所述 )。 因为我正在使用AVAudioSessionCategoryPlayAndRecord应该正常工作。 这可能是一个错误。 如果您遇到同样的问题,请复制。 In iOS 7 Airplay options can be determined by the Audio Category you set (as discussed in QA1803). Since I'm using AVAudioSessionCateg ...
  • 我可以通过在此答案中使用解决方案来解决此问题: 如何检查设备是否通过airplay连接? 不是最好的解决方案,但可能是唯一可用的解决方案。 I could solve this by using the solution in this answer: How to check if the device is connected via airplay? Not the best solution, but probably the only available one.
  • 解决方案是我使用DWM缩略图作为源窗口: hr = DwmRegisterThumbnail(); hr = DwmUpdateThumbnailProperties(); 正如@ raymond-chen所说。 The solution was that I used DWM thumbnailing for the source window: hr = DwmRegisterThumbnail(); hr = DwmUpdateThumbnailProperties(); as @raymond- ...
  • 这是github上很棒的图书馆 https://github.com/nicklockwood/ReflectionView here is great library on github for doing this https://github.com/nicklockwood/ReflectionView
  • 这是正确的方法。 设置远程位置以镜像主要Nexus。 (以管理员身份登录,存储库,添加,代理存储库。 然后在开发人员的Maven settings.xml中添加远程位置的Nexus作为主要Nexus的镜像。 首先,访问工件被复制到远程位置。 而已。 That is the right way. Set up your remote location to mirror the main Nexus. (Login as admin, Repositories, Add, Proxy Repository. ...

相关文章

更多

最新问答

更多
  • h2元素推动其他h2和div。(h2 element pushing other h2 and div down. two divs, two headers, and they're wrapped within a parent div)
  • 创建一个功能(Create a function)
  • 我投了份简历,是电脑编程方面的学徒,面试时说要培训三个月,前面
  • PDO语句不显示获取的结果(PDOstatement not displaying fetched results)
  • Qt冻结循环的原因?(Qt freezing cause of the loop?)
  • TableView重复youtube-api结果(TableView Repeating youtube-api result)
  • 如何使用自由职业者帐户登录我的php网站?(How can I login into my php website using freelancer account? [closed])
  • SQL Server 2014版本支持的最大数据库数(Maximum number of databases supported by SQL Server 2014 editions)
  • 我如何获得DynamicJasper 3.1.2(或更高版本)的Maven仓库?(How do I get the maven repository for DynamicJasper 3.1.2 (or higher)?)
  • 以编程方式创建UITableView(Creating a UITableView Programmatically)
  • 如何打破按钮上的生命周期循环(How to break do-while loop on button)
  • C#使用EF访问MVC上的部分类的自定义属性(C# access custom attributes of a partial class on MVC with EF)
  • 如何获得facebook app的publish_stream权限?(How to get publish_stream permissions for facebook app?)
  • 如何防止调用冗余函数的postgres视图(how to prevent postgres views calling redundant functions)
  • Sql Server在欧洲获取当前日期时间(Sql Server get current date time in Europe)
  • 设置kotlin扩展名(Setting a kotlin extension)
  • 如何并排放置两个元件?(How to position two elements side by side?)
  • 如何在vim中启用python3?(How to enable python3 in vim?)
  • 在MySQL和/或多列中使用多个表用于Rails应用程序(Using multiple tables in MySQL and/or multiple columns for a Rails application)
  • 如何隐藏谷歌地图上的登录按钮?(How to hide the Sign in button from Google maps?)
  • Mysql左连接旋转90°表(Mysql Left join rotate 90° table)
  • dedecms如何安装?
  • 在哪儿学计算机最好?
  • 学php哪个的书 最好,本人菜鸟
  • 触摸时不要突出显示表格视图行(Do not highlight table view row when touched)
  • 如何覆盖错误堆栈getter(How to override Error stack getter)
  • 带有ImageMagick和许多图像的GIF动画(GIF animation with ImageMagick and many images)
  • USSD INTERFACE - > java web应用程序通信(USSD INTERFACE -> java web app communication)
  • 电脑高中毕业学习去哪里培训
  • 正则表达式验证SMTP响应(Regex to validate SMTP Responses)