restruct/silverstripe-cfstreamvideo

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 4

Forks: 0

Open Issues: 3

Type:silverstripe-vendormodule

1.0.2 2022-01-07 20:07 UTC

This package is auto-updated.

Last update: 2024-12-08 02:05:43 UTC


README

Silverstripe CloudFlareStream video streaming module

This Silverstripe module provides video uploading to– and streaming from CloudFlareStream via its API.

In includes:

  • A DB StreamVideo object to hold video data & settings, and keep track of the status
  • A StreamVideoPage object providing an upload interface (using FilePond)
  • A StreamVideoAdminController to handle interactions in the admin section (like API interactions, providing shortcode placeholder, etc)
  • Configurable options (on StreamVideoAdminController) / environment options:
    • (ENV) APP_CFSTREAM_API_HOST, APP_CFSTREAM_ACCOUNT_ID, APP_CFSTREAM_ACCOUNT_EMAIL, APP_CFSTREAM_API_TOKEN
    • (ENV) APP_CFSTREAM_SIGNING_KEY_ID, APP_CFSTREAM_SIGNING_KEY_PEM, APP_CFSTREAM_SIGNING_KEY_JWK
    • (StreamVideoObject::config()) $signed_buffer_hours
  • The initial version of this module:
    • (1) saves uploaded vids locally,
    • (2) posts an API request to copy the vid to Stream,
    • (3) polls (onload/init) the status upon rendering and,
    • (4) (configurable) removes the local video upon status 'ready'
  • Uploads work via FilePond (as Silverstripe in all their wisdom consider chunked uploads out of scope) using chunking for large uploads (custom filepond config, based on the yet to be published Restruct Admintweaks module)
  • A ShortCode + Placeholder are provided for easy inclusion of vids in the editor (also on 'regular' pages)
    • The shortcode hooks into the yet to be published Restruct Shortcodable module
    • The modal has a dropdown to select the video by title/name and checkboxes for options: show controls, autoplay, preload, start muted, p
  • A ModelAdmin interface is included to view & edit existing vids, or upload new ones (without having to create a StreamVideoPage):
    • Videos can be set to be 'protected' (require a signed URL via Stream API)
    • Videos can have whitelisted (only) domains & countries, the default/current website domain is whitelisted by default if whitelisting is active
    • The initial version allows setting/uploading a custom poster image for a video (overriding the one provided by Stream API)
    • A later version of this module provides could allow managing signing keys from model admin (using the Stream API)
    • A later version of this module provides some way/Ui to change/select the poster image (via a Stream API call)
  • Prevent video downloading identical to this WP module (under the hood explanation)
OEmbed (https://oembed.com/ & https://timnash.co.uk/becoming-oembed-provider/)
  • Videos may be made available via OEmbed (currently all of them are, except probably for ones marked as requiring signed URLs)
    • OEmbedding is by default limited to the current domain via a Config property (independent of video-whitelisted domains & countries)
    • Additional allowed domains may be whitelisted in Config
    • OEmbedding may also be configured to allow ANY domain (effectively disables whitelist/limiting alltogether)

REFS: