VideoPackage
Summary
Defines a VideoPackage to manage publication of a video file.
Constructor
VideoPackage
Syntax
VideoPackage
-
mediaPackage
-
videoProvider
Summary
Parameters:
-
mediaPackage
ObjectInformation about the video
-
videoProvider
VideoProviderA video provider
Item Index
Methods
Properties
- mediaPackage
- publishConf
- stateMachine static
- STATES static
- stateTransitions static
- TRANSITIONS static
- videoPlatformConf
- videoProvider
Events
Methods
cleanDirectory
Syntax
cleanDirectory
()
Summary
Removes extracted tar files from temporary directory.
This is a transition.
copyImages
Syntax
copyImages
()
Summary
Copies presentation images from temporary directory to the public directory.
This is a transition.
copyPackage
Syntax
copyPackage
()
Summary
Copies package from its submitted directory to temporary directory.
This is a transition.
defragmentMp4
Syntax
defragmentMp4
()
Summary
Defragment the MP4
If the input file is fragmented, ffmpeg will be used to defragment the MP4. The fragmentation detection of the file is based on an un- known "nb_frames" property in ffprobe output metadata.
executeTransition
Syntax
executeTransition
-
transition
Summary
Starts executing at the given transition.
The rest of the transitions stack will be executed.
Parameters:
-
transition
StringThe transition to launch
generateThumb
Syntax
generateThumb
()
Summary
Generates a thumbnail for the video.
If no thumbnail has been provided by the user form, ffmpeg will be used to extract an image from the video to generate a thumbnail.
This is a transition.
getMediaFilePath
Syntax
Summary
Gets the media file path of the package.
Returns:
System path of the media file
getMetadata
Syntax
getMetadata
()
Summary
Retrieves video height from video metadatas.
This is a transition.
getStateMachine
Syntax
Summary
Gets the list of transitions states corresponding to the package.
Returns:
The list of states/transitions
getTransitions
Syntax
Summary
Gets the stack of transitions corresponding to the package.
Each package has its own way to be published, thus transitions stack is different by package.
Returns:
The stack of transitions
init
Syntax
init
-
initialState
-
initialTransition
Summary
Creates a state machine to publish the package.
initPackage
Syntax
initPackage
()
Summary
Initializes and stores the package.
This is a transition.
preparePublicDirectory
Syntax
preparePublicDirectory
()
Summary
Prepares public directory where the media associated files will be deployed.
This is a transition.
removeOriginalPackage
Syntax
removeOriginalPackage
()
Summary
Removes original package.
This is a transition.
setError
Syntax
setError
-
error
Summary
Sets a package as in error.
Parameters:
-
error
PublishErrorThe package error
synchronizeMedia
Syntax
synchronizeMedia
()
Summary
Synchronizes uploaded media information with the media platform.
This is a transition.
updateState
Syntax
updateState
-
id
-
state
-
callback
Summary
Updates media state and sends an event to inform about state changed.
uploadMedia
Syntax
uploadMedia
()
Summary
Uploads the media to the video platform.
This is a transition.
Properties
stateMachine
Syntax
Summary
Define machine state authorized transitions depending on previous and next states.
stateTransitions
Syntax
Summary
Define the order in which transitions will be executed for a video Package.
TRANSITIONS
Syntax
Summary
Video package process transitions (from one state to another).
videoPlatformConf
Syntax
Summary
Video platforms configuration object from videoPlatformConf.json file.
Events
complete
Syntax
complete
Summary
Fired when package processing has succeed.
Event Payload:
-
The
Objectprocessed package
error
Syntax
error
Summary
Fired when an error occurred while processing the package.
Event Payload:
-
The
Errorerror
stateChanged
Syntax
stateChanged
Summary
Fired when package state has changed.
Event Payload:
-
The
Objectprocessed package