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 later version may use FilePond combined with TUS to upload large videos directly to Stream
- 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)
- 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)
- Stream API docs
- This module: Listing of most required API calls
- This module: Wordpress Stream module (esp. API class)
- Laravel CloudFlareStream
- Earlier Restruct HTML5 movies/media module may contain some reusable parts like status polling job (but we probably could do with just checking the status eg from 'canView()' or so...)