Is it possible to post video on Facebook user timeline using Facebook Autopost module?
-
12-12-2020 - |
Pergunta
I need to upload videos to Facebook and I'm using Facebook Autopost and Rules module.
I've followed the video tutorials from:
- Facebook Autopost
- Drupal & Facebook : How to Post Drupal content on Facebook P 2/2
- Drupal & Facebook : How to Post Drupal content on Facebook - Drupal 7, Drupal 8.
They teach how to post images and text but none mention videos. How can I upload videos with this module?
Solução
No. Not without building upon it. While the version of the FB PHP SDK (3.2.3) that the module relies on supports uploading video, there is no support for it in the module.
Looking at the current module, it looks possible to build in support. For example, take the scenario where the module supports uploading an image to the user timeline:
- The rule action triggers
rules_action_publish_to_facebook_timeline()
which retrieves (infacebook_autopost_entity()
) aFBAutopostEntityPhoto
object which is extended from theFBAutoPostEntity
class. - When
FBAutoPostEntity::publishEntity()
is called to publish the entity, it calls a parent methodFBAutopost::publish()
which checks a list of types that does include avideo
type.
Presumably, one could extend another class (e.g. FBAutopostEntityVideo
) from FBAutoPostEntity
that would add the various details for base classes that would allow it to plug in to the underlying SDK.
To sum it up, the existing module doesn't support however there's some support at lower levels in the code. That comes with the caveat that there might be more overhead to add (e.g. is there more to defining a Video entity than just extending the FBAutoPostEntity
class) than what I mentioned here.