Class SubtitleTimeshiftWorkflowOperationHandler
java.lang.Object
org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
org.opencastproject.workflow.handler.subtitletimeshift.SubtitleTimeshiftWorkflowOperationHandler
- All Implemented Interfaces:
WorkflowOperationHandler
This workflow operation allows to shift the timestamps of subtitle files.
For example: If someone adds a bumper/intro video in front of an already subtitled presenter track
the subtitles would start too early. With this operation, you can select a video and a subtitle track and the
timestamps of the subtitle file will be shifted backwards by the duration of the selected video.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
AbstractWorkflowOperationHandler.Configuration -
Field Summary
Fields inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
asList, description, id, serviceRegistry, SOURCE_FLAVOR, SOURCE_FLAVORS, SOURCE_TAG, SOURCE_TAGS, TARGET_FLAVOR, TARGET_FLAVORS, TARGET_TAG, TARGET_TAGS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidsetWorkspace(Workspace workspace) OSGi setter for the workspace classvoidshiftTime(WebVTTSubtitle subtitleFile, long time) Shifts all timestamps of a subtitle file by a given time.start(WorkflowInstance workflowInstance, JobContext context) Runs the workflow operation on thisWorkflowInstance.Methods inherited from class org.opencastproject.workflow.api.AbstractWorkflowOperationHandler
activate, asList, cfgKeyMissing, createResult, createResult, createResult, createResult, destroy, equals, getCfg, getConfig, getConfig, getConfig, getDescription, getFileNameFromElements, getId, getOptConfig, getOptConfig, getTagsAndFlavors, hashCode, setJobBarrierPollingInterval, setServiceRegistry, skip, toString, waitForStatus, waitForStatus
-
Constructor Details
-
SubtitleTimeshiftWorkflowOperationHandler
public SubtitleTimeshiftWorkflowOperationHandler()
-
-
Method Details
-
setWorkspace
OSGi setter for the workspace class- Parameters:
workspace- an instance of the workspace
-
start
public WorkflowOperationResult start(WorkflowInstance workflowInstance, JobContext context) throws WorkflowOperationException Description copied from class:AbstractWorkflowOperationHandlerRuns the workflow operation on thisWorkflowInstance. If the execution fails for some reason, this must throw aWorkflowOperationExceptionin order to handle the problem gracefully. Runtime exceptions will cause the entire workflow instance to fail.- Specified by:
startin interfaceWorkflowOperationHandler- Specified by:
startin classAbstractWorkflowOperationHandler- Parameters:
workflowInstance- the workflow instancecontext- the job context- Returns:
- the
WorkflowOperationResultcontaining a potentially modified MediaPackage and whether to put the workflow instance into a wait state. - Throws:
WorkflowOperationException- If the workflow operation fails to execute properly, and the default error handling should be invoked.- See Also:
-
shiftTime
Shifts all timestamps of a subtitle file by a given time.- Parameters:
time- Time in milliseconds by which all timestamps shall be shifted.
-