CloudflareStreamVideo class
Documentation here: API docs: https://api.cloudflare.com/#stream-videos-properties Developer Cloudflare docs: https://developers.cloudflare.com/stream
- Available Extensions
- Annotations
-
- @CopyWith(skipFields: true)
- @JsonSerializable(includeIfNull: false)
Constructors
-
CloudflareStreamVideo({String? id, DateTime? uploaded, int? size, Watermark? watermark, bool? requireSignedURLs, Map? meta, List<
String> ? allowedOrigins, int? maxDurationSeconds, DateTime? created, String? preview, DateTime? modified, VideoSize? input, String? thumbnail, String? animatedThumbnail, VideoStatus? status, double? duration, DateTime? uploadExpiry, double? thumbnailTimestampPct, VideoPlaybackInfo? playback, MediaNFT? nft, bool? readyToStream, String? liveInput, String? customAccountSubdomainUrl}) -
CloudflareStreamVideo.fromJson(Map<
String, dynamic> json) -
factory
Properties
-
allowedOrigins
↔ List<
String> -
List which origins should be allowed to display the video.
Enter allowed origin domains in an array and use * for wildcard
subdomains. Empty array will allow the video to be viewed on any origin.
getter/setter pair
- animatedThumbnail → String
-
URI to GIF thumbnail for a media item. Omitted until encoding is complete.
final
- created → DateTime
-
When the media item was created.
Using ISO 8601 ZonedDateTime
final
- customAccountSubdomainUrl → String?
-
Domain that is specific to your Cloudflare account: like customer-{CODE}.cloudflarestream.com.
final
- duration → double
-
Duration of the video in seconds. A value of -1 means the duration is
unknown. The duration becomes available after the upload,
before the video is ready.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
Media item unique identifier
max length: 32
final
- input → VideoSize
-
Size of the video after upload is completed and before video is ready.
e.g:
{
"height": 1080,
"width": 1920
}
final
- isReady → bool
-
no setter
- liveInput → String?
-
Live input ID that was used to upload this video with Stream Live.
final
- maxDurationSeconds ↔ int?
-
Maximum duration for a video upload. Can be set for a video that is not
yet uploaded to limit its duration. Uploaded that exceed this duration
will fail during processing. A value of -1 means the value is unknown.
getter/setter pair
- meta ↔ Map?
-
User modifiable key-value store. Can be used for keeping references
to another system of record for managing videos.
getter/setter pair
- modified → DateTime
-
When the media item was last modified.
Using ISO 8601 ZonedDateTime
final
- nft → MediaNFT?
-
read only
final
- playback → VideoPlaybackInfo?
-
read only
final
- preview → String
-
URI of preview page for video. Omitted until encoding is complete.
final
- readyToStream → bool
-
Indicates whether the video is ready for viewing.
final
- requireSignedURLs → bool
-
Indicates whether the video can be a accessed only using it's UID.
If set to true, a signed token needs to be generated with a signing key
to view the video.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → int
-
Size of the media item in bytes.
final
- status → VideoStatus
-
Object specifying more fine-grained status for this video item.
If "state" is "inprogress" or "error", "step" will be one of "encoding"
or "manifest". When "state" is "inprogress", "pctComplete" will be a
number between 0 and 100 indicating the approximate percent of that step
that has been completed. If the "state" is "error", "errorReasonCode" and
"errorReasonText" will contain additional details.
final
- thumbnail → String
-
URI to JPG thumbnail for a media item. Omitted until encoding is complete.
final
- thumbnailTimestampPct ↔ double
-
Timestamp location of thumbnail image calculated as a percentage value of
the video's duration. To convert from a second-wise timestamp to a
percentage, divide the desired timestamp by the total duration of the
video. If this value is not set, the default thumbnail image will be
from 0s of the video.
getter/setter pair
- uploaded → DateTime
-
When the media item was uploaded.
Using ISO 8601 ZonedDateTime
final
- uploadExpiry ↔ DateTime?
-
Date at which the video upload URL is no longer valid for direct user uploads.
getter/setter pair
- watermark ↔ Watermark?
-
You can create watermark profile for different videos.
getter/setter pair
Methods
-
customAnimatedThumbnail(
{String? time, int? width, int? height, ThumbnailFit? fit, String? duration, int? fps}) → String - Customizing animated GIF thumbnails on the fly
-
customThumbnail(
{String? time, int? width, int? height, ThumbnailFit? fit}) → String - Customizing static JPG thumbnails on the fly
-
fromJsonList(
List? jsonList) → List< CloudflareStreamVideo> ? -
inherited
-
fromJsonMap(
Map< String, dynamic> ? json) → CloudflareStreamVideo? -
fromJsonString(
String? json) → CloudflareStreamVideo? -
inherited
-
fromJsonStringList(
String? jsonStringList) → List< CloudflareStreamVideo> ? -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toJsonMap(
) → Map< String, dynamic> -
inherited
-
toJsonString(
) → String -
inherited
-
toString(
) → String -
This is just to suggest children to implement a named constructor to
support creating objects fromJson(...) and fromJsonString(...) as easy as
T.build().fromJson(...) or T.build().fromJsonString(...)
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Static Properties
Static Methods
-
customAccountSubdomainFromUrl(
String? url) → String? -
dataFromVideoDeliveryUrl(
String url) → Map< String, dynamic> -
fromUrl(
String url) → CloudflareStreamVideo? - Builds a CloudflareStreamVideo from an url if url is properly created
Constants
- specificCloudflareAccountSubdomainGeneric → const String
- uploadVideoDeliveryUrl → const String
- videoCloudflareUrl → const String
- videoDeliveryUrl → const String
- watchVideoDeliveryUrl → const String