Video class
A generated video job.
Structured information describing a generated video job from Sora.
Example
final video = await client.videos.retrieve('video-abc123');
print('Status: ${video.status}');
print('Progress: ${video.progress}%');
- Annotations
-
- @immutable
Constructors
- Video({required String id, required String object, required String model, required VideoStatus status, required int progress, required int createdAt, required int? completedAt, required int? expiresAt, required String? prompt, required VideoSize size, required VideoSeconds seconds, required String? remixedFromVideoId, VideoError? error})
-
Creates a Video.
const
-
Video.fromJson(Map<
String, dynamic> json) -
Creates a Video from JSON.
factory
Properties
- completedAt → int?
-
Unix timestamp (seconds) for when the job completed, if finished.
final
- completedAtDateTime → DateTime?
-
The completion time as a DateTime, if completed.
no setter
- createdAt → int
-
Unix timestamp (seconds) for when the job was created.
final
- createdAtDateTime → DateTime
-
The creation time as a DateTime.
no setter
- error → VideoError?
-
Error payload that explains why generation failed, if applicable.
final
- expiresAt → int?
-
Unix timestamp (seconds) for when the downloadable assets expire, if set.
final
- expiresAtDateTime → DateTime?
-
The expiration time as a DateTime, if set.
no setter
- hashCode → int
-
The hash code for this object.
no setteroverride
- id → String
-
Unique identifier for the video job.
final
- isCompleted → bool
-
Whether the video generation has completed.
no setter
- isFailed → bool
-
Whether the video generation has failed.
no setter
- isRemix → bool
-
Whether this video is a remix of another video.
no setter
- model → String
-
The video generation model that produced the job.
final
- object → String
-
The object type, which is always
video.final - progress → int
-
Approximate completion percentage for the generation task.
final
- prompt → String?
-
The prompt that was used to generate the video.
final
- remixedFromVideoId → String?
-
Identifier of the source video if this video is a remix.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seconds → VideoSeconds
-
Duration of the generated clip in seconds.
final
- size → VideoSize
-
The resolution of the generated video.
final
- status → VideoStatus
-
Current lifecycle status of the video job.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts to JSON.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override