我可以使用 RestFB 发布带有描述的视频。我想将缩略图添加到视频中。我怎样才能做到这一点?
我尝试在发布时添加一些参数
Parameter.with("thumb", BinaryAttachment.with(fileName, fetchBytesFromImage(fileName)))
Parameter.with("picture", BinaryAttachment.with(fileName, fetchBytesFromImage(fileName)))
最佳答案
如果发布多个 BinaryAttachment
,则必须将 fieldname
添加到 BinaryAttachment.with
方法,将两个 BinaryAttachment
中的 List
并在发布方法中使用它。
看起来像这样:
fbClient.publish("me/videos", GraphResponse.class,
Arrays.asList(
BinaryAttachment.with("source","1.mp4",inputstream),
BinaryAttachment.with("thumb", "bla.jpg", fetchBytesFromImage("bla.jpg"))),
Parameter.with("description", "Test Thumb"));
关于java - 如何使用 RestFB 发布带有自定义缩略图的视频?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56246790/