Package
Summary
Defines a Package to manage publication of a media file.
Constructor
Package
Syntax
Package
        - 
                        mediaPackage
- 
                        videoProvider
Summary
Parameters:
- 
                        mediaPackageObjectInformation about the media 
- 
                        videoProviderVideoProviderMedia 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.
copyPackage
Syntax
copyPackage
        ()
  Summary
Copies package from its submitted directory to temporary directory.
This is a transition.
executeTransition
Syntax
executeTransition
        - 
                        transition
Summary
Starts executing at the given transition.
The rest of the transitions stack will be executed.
Parameters:
- 
                        transitionStringThe transition to launch 
getMediaFilePath
Syntax
Summary
Gets the media file path of the package.
Returns:
System path of the media file
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.
removeOriginalPackage
Syntax
removeOriginalPackage
        ()
  Summary
Removes original package.
This is a transition.
setError
Syntax
setError
        - 
                        error
Summary
Sets a package as in error.
Parameters:
- 
                        errorPublishErrorThe 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 Package.
TRANSITIONS
Syntax
Summary
Package 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:
- 
                                            TheObjectprocessed package 
error
Syntax
error
                        
                    
                    
                    
                    
                    
                      Summary
Fired when an error occurred while processing the package.
Event Payload:
- 
                                            TheErrorerror 
stateChanged
Syntax
stateChanged
                        
                    
                    
                    
                    
                    
                      Summary
Fired when package state has changed.
Event Payload:
- 
                                            TheObjectprocessed package