VideoFrame

Inheritance: java.lang.Object, com.aspose.slides.Shape, com.aspose.slides.GeometryShape, com.aspose.slides.PictureFrame

All Implemented Interfaces: com.aspose.slides.IVideoFrame

public class VideoFrame extends PictureFrame implements IVideoFrame

Represents a video clip on a slide.

Methods

MethodDescription
getRewindVideo()Determines whether a video is automatically rewinded to start as soon as the movie has finished playing.
setRewindVideo(boolean value)Determines whether a video is automatically rewinded to start as soon as the movie has finished playing.
getPlayLoopMode()Determines whether a video is looped.
setPlayLoopMode(boolean value)Determines whether a video is looped.
getHideAtShowing()Determines whether a VideoFrame is hidden.
setHideAtShowing(boolean value)Determines whether a VideoFrame is hidden.
getVolume()Returns or sets the audio volume.
setVolume(int value)Returns or sets the audio volume.
getVolumeValue()Returns or sets the exact video volume as a percentage.
setVolumeValue(float value)Returns or sets the exact video volume as a percentage.
getPlayMode()Returns or sets the video play mode.
setPlayMode(int value)Returns or sets the video play mode.
getFullScreenMode()Determines whether a video is shown in full screen mode.
setFullScreenMode(boolean value)Determines whether a video is shown in full screen mode.
getLinkPathLong()Returns or sets the name of an video file which is linked to a VideoFrame.
setLinkPathLong(String value)Returns or sets the name of an video file which is linked to a VideoFrame.
getEmbeddedVideo()Returns or sets embedded video object.
setEmbeddedVideo(IVideo value)Returns or sets embedded video object.
getTrimFromStart()Trim start [ms]
setTrimFromStart(float value)Trim start [ms]
getTrimFromEnd()Trim end [ms]
setTrimFromEnd(float value)Trim end [ms]
getCaptionTracks()Gets the collection of closed captions associated with the video frame.

getRewindVideo()

public final boolean getRewindVideo()

Determines whether a video is automatically rewinded to start as soon as the movie has finished playing. Read/write boolean.

Returns: boolean

setRewindVideo(boolean value)

public final void setRewindVideo(boolean value)

Determines whether a video is automatically rewinded to start as soon as the movie has finished playing. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getPlayLoopMode()

public final boolean getPlayLoopMode()

Determines whether a video is looped. Read/write boolean.

Returns: boolean

setPlayLoopMode(boolean value)

public final void setPlayLoopMode(boolean value)

Determines whether a video is looped. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getHideAtShowing()

public final boolean getHideAtShowing()

Determines whether a VideoFrame is hidden. Read/write boolean.

Returns: boolean

setHideAtShowing(boolean value)

public final void setHideAtShowing(boolean value)

Determines whether a VideoFrame is hidden. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getVolume()

public final int getVolume()

Returns or sets the audio volume. Read/write AudioVolumeMode.

Returns: int

setVolume(int value)

public final void setVolume(int value)

Returns or sets the audio volume. Read/write AudioVolumeMode.

Parameters:

ParameterTypeDescription
valueint

getVolumeValue()

public final float getVolumeValue()

Returns or sets the exact video volume as a percentage. The value is expressed as a percentage from 0 to 100. Use this property to read or set volume values that are more precise than the predefined levels available through the #getVolume.getVolume/#setVolume(int).setVolume(int) property. Read/write float .


Example:
  
 Presentation pres = new Presentation("video.pptx");
 try {
     IVideoFrame videoFrame = (IVideoFrame)pres.getSlides().get_Item(0).getShapes().get_Item(0);
     // Read the current exact volume and set it to 75.5 percent.
     float currentVolume = videoFrame.getVolumeValue();
     System.out.println(currentVolume);
     videoFrame.setVolumeValue(75.5f);
     pres.save("video_with_volume.pptx", SaveFormat.Pptx);
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: float

setVolumeValue(float value)

public final void setVolumeValue(float value)

Returns or sets the exact video volume as a percentage. The value is expressed as a percentage from 0 to 100. Use this property to read or set volume values that are more precise than the predefined levels available through the #getVolume.getVolume/#setVolume(int).setVolume(int) property. Read/write float .


Example:
  
 Presentation pres = new Presentation("video.pptx");
 try {
     IVideoFrame videoFrame = (IVideoFrame)pres.getSlides().get_Item(0).getShapes().get_Item(0);
     // Read the current exact volume and set it to 75.5 percent.
     float currentVolume = videoFrame.getVolumeValue();
     System.out.println(currentVolume);
     videoFrame.setVolumeValue(75.5f);
     pres.save("video_with_volume.pptx", SaveFormat.Pptx);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
valuefloat

getPlayMode()

public final int getPlayMode()

Returns or sets the video play mode. Read/write VideoPlayModePreset.

Returns: int

setPlayMode(int value)

public final void setPlayMode(int value)

Returns or sets the video play mode. Read/write VideoPlayModePreset.

Parameters:

ParameterTypeDescription
valueint

getFullScreenMode()

public final boolean getFullScreenMode()

Determines whether a video is shown in full screen mode. Read/write boolean.

Returns: boolean

setFullScreenMode(boolean value)

public final void setFullScreenMode(boolean value)

Determines whether a video is shown in full screen mode. Read/write boolean.

Parameters:

ParameterTypeDescription
valueboolean

getLinkPathLong()

public final String getLinkPathLong()

Returns or sets the name of an video file which is linked to a VideoFrame. Read/write String.

Returns: java.lang.String

setLinkPathLong(String value)

public final void setLinkPathLong(String value)

Returns or sets the name of an video file which is linked to a VideoFrame. Read/write String.

Parameters:

ParameterTypeDescription
valuejava.lang.String

getEmbeddedVideo()

public final IVideo getEmbeddedVideo()

Returns or sets embedded video object. Read/write IVideo.

Returns: IVideo

setEmbeddedVideo(IVideo value)

public final void setEmbeddedVideo(IVideo value)

Returns or sets embedded video object. Read/write IVideo.

Parameters:

ParameterTypeDescription
valueIVideo

getTrimFromStart()

public final float getTrimFromStart()

Trim start [ms]


Example:
 
 Presentation pres = new Presentation();
 try {
     ISlide slide = pres.getSlides().get_Item(0);
     IVideo video = pres.getVideos().addVideo(Files.readAllBytes(Paths.get("video.mp4")));
     IVideoFrame videoFrame = slide.getShapes().addVideoFrame(0, 0, 100, 100, video);
     //set triming start time 1sec
     videoFrame.setTrimFromStart(1000f);
     //set triming end time 2sec
     videoFrame.setTrimFromEnd(2000f);
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: float

setTrimFromStart(float value)

public final void setTrimFromStart(float value)

Trim start [ms]


Example:
 
 Presentation pres = new Presentation();
 try {
     ISlide slide = pres.getSlides().get_Item(0);
     IVideo video = pres.getVideos().addVideo(Files.readAllBytes(Paths.get("video.mp4")));
     IVideoFrame videoFrame = slide.getShapes().addVideoFrame(0, 0, 100, 100, video);
     //set triming start time 1sec
     videoFrame.setTrimFromStart(1000f);
     //set triming end time 2sec
     videoFrame.setTrimFromEnd(2000f);
 } finally {
     if (pres != null) pres.dispose();
 }

Parameters:

ParameterTypeDescription
valuefloat

getTrimFromEnd()

public final float getTrimFromEnd()

Trim end [ms]

Returns: float

setTrimFromEnd(float value)

public final void setTrimFromEnd(float value)

Trim end [ms]

Parameters:

ParameterTypeDescription
valuefloat

getCaptionTracks()

public final ICaptionsCollection getCaptionTracks()

Gets the collection of closed captions associated with the video frame. This property is read-only and returns an ICaptionsCollection containing all caption tracks.


Example:
  
 Presentation pres = new Presentation("video with captions.pptx");
 try {
     for (IShape shape : pres.getSlides().get_Item(0).getShapes())
     {
         if (!(shape instanceof IVideoFrame))
             continue;
         IVideoFrame videoFrame = (IVideoFrame) shape;
         for (ICaptions captionTrack : videoFrame.getCaptionTracks())
         {
             // Extracts the captions binary data and saves them to the file
             FileOutputStream fos = new FileOutputStream(captionTrack.getCaptionId() + ".vtt");
             fos.write(captionTrack.getBinaryData());
             fos.close();
         }
     }
 } finally {
     if (pres != null) pres.dispose();
 }

Returns: ICaptionsCollection