OpenVeo Publish server

API Docs for: 8.0.0
Show:

VideoPackage

Summary

Defines a VideoPackage to manage publication of a video file.

Constructor

VideoPackage

Syntax

VideoPackage

(
  • mediaPackage
  • videoProvider
)

Summary

Parameters:

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 String

    The 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

getMediaFilePath

() String

Summary

Gets the media file path of the package.

Returns:

String:

System path of the media file

getMetadata

Syntax

getMetadata

()

Summary

Retrieves video height from video metadatas.

This is a transition.

getStateMachine

Inherited from Package but overwritten in app/server/packages/VideoPackage.js:433

Syntax

getStateMachine

() Array

Summary

Gets the list of transitions states corresponding to the package.

Returns:

Array:

The list of states/transitions

getTransitions

Inherited from Package but overwritten in app/server/packages/VideoPackage.js:420

Syntax

getTransitions

() Array

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:

Array:

The stack of transitions

init

Syntax

init

(
  • initialState
  • initialTransition
)

Summary

Creates a state machine to publish the package.

Parameters:

  • initialState String

    Initial machine state

  • initialTransition String

    Initial machine transition

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:

synchronizeMedia

Syntax

synchronizeMedia

()

Summary

Synchronizes uploaded media information with the media platform.

This is a transition.

updateState

Syntax

updateState

(
  • id
  • state
  • callback
)
async

Summary

Updates media state and sends an event to inform about state changed.

Parameters:

  • id Number

    The id of the media to update

  • state String

    The state of the media

  • callback Function

    The function to call when it's done

    • Error The error if an error occurred, null otherwise
    • Number The number of updated items

uploadMedia

Syntax

uploadMedia

()

Summary

Uploads the media to the video platform.

This is a transition.

Properties

mediaPackage

Syntax

mediaPackage

Object

Summary

Media package description object.

publishConf

Syntax

publishConf

Object final

Summary

Publish configuration.

stateMachine

Syntax

stateMachine

Array final static

Summary

Define machine state authorized transitions depending on previous and next states.

STATES

Syntax

STATES

Object final static

Summary

Process states for video packages.

stateTransitions

Syntax

stateTransitions

Array final static

Summary

Define the order in which transitions will be executed for a video Package.

TRANSITIONS

Syntax

TRANSITIONS

Object final static

Summary

Video package process transitions (from one state to another).

videoPlatformConf

Syntax

videoPlatformConf

Object final

Summary

Video platforms configuration object from videoPlatformConf.json file.

videoProvider

Syntax

videoProvider

VideoProvider final

Summary

Media provider.

Events

complete

Syntax

complete

Summary

Fired when package processing has succeed.

Event Payload:

  • The Object

    processed package

error

Syntax

error

Summary

Fired when an error occurred while processing the package.

Event Payload:

stateChanged

Syntax

stateChanged

Summary

Fired when package state has changed.

Event Payload:

  • The Object

    processed package