Create Caption Tracks for a Video Frame Introduction
The following API method allows you to add caption tracks to a video frame.
CreateVideoCaptionTrack
API
Type
Description
Resource
/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/captionTracks
POST
Creates a caption track for a video frame.
CreateVideoCaptionTrack
Request Parameters
Name
Type
Location
Required
Description
name
string
path
true
The name of a presentation file.
slideIndex
integer
path
true
The 1-based index of the slide.
shapeIndex
integer
path
true
The 1-based index of the shape; must refer to a video frame.
label
string
query
true
The label of the caption track.
data
string
body
true
The content of the caption track.
password
string
header
false
The password to open the presentation.
folder
string
query
false
The path to the folder containing the presentation.
storage
string
query
false
The name of the storage contaning the folder
.
In case of Amazon S3 storage folder path starts with Amazon S3 bucket name.
Examples
Create a caption track for a video frame, which is the 1st shape on the 3rd slide in MyFolder/MyPresentation.pptx file saved to the default storage.
cURL Solution
SDK Solutions
C#
Copy
using Aspose.Slides.Cloud.Sdk ;
using System.Diagnostics ;
class Application
{
static void Main ( )
{
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
const string captionsData = @"WEBVTT
00:00:00.000-- > 00:00:10.000
Caption text." ;
slidesApi . CreateVideoCaptionTrack ( "MyPresentation.pptx" , 3 , 1 , "Captions" , captionsData , "MyFolder" );
}
}
Java
Copy
import com.aspose.slides.ApiException ;
import com.aspose.slides.api.SlidesApi ;
public class Application {
public static void main ( String [] args ) throws ApiException {
SlidesApi slidesApi = new SlidesApi ( "MyClientId" , "MyClientSecret" );
String captionsData = "WEBVTT\n\n00:00:00.000-- > 00:00:10.000\nCaption text." ;
slidesApi . createVideoCaptionTrack ( "MyPresentation.pptx" , 3 , 1 , "Captions" , captionsData , "MyFolder" , null );
}
}
PHP
Copy
use Aspose \Slides \Cloud \Sdk \Api \Configuration ;
use Aspose \Slides \Cloud \Sdk \Api \SlidesApi ;
$configuration = new Configuration ();
$configuration -> setAppSid ( "MyClientId" );
$configuration -> setAppKey ( "MyClientSecret" );
$slidesApi = new SlidesApi ( null , $configuration );
$captionsData = "WEBVTT \n\n 00:00:00.000-- > 00:00:10.000 \n Caption text." ;
$slidesApi -> createVideoCaptionTrack ( "MyPresentation.pptx" , 3 , 1 , "Captions" , $captionsData , "MyFolder" );
Ruby
Copy
require "aspose_slides_cloud"
include AsposeSlidesCloud
configuration = Configuration . new
configuration . app_sid = "MyClientId"
configuration . app_key = "MyClientSecret"
slides_api = SlidesApi . new ( configuration )
captions_data = "WEBVTT \n\n 00:00:00.000-- > 00:00:10.000 \n Caption text."
slides_api . create_video_caption_track ( "MyPresentation.pptx" , 3 , 1 , "Captions" , captions_data , "MyFolder" )
Python
Copy
import asposeslidescloud
from asposeslidescloud.apis.slides_api import SlidesApi
slides_api = SlidesApi ( None , "MyClientId" , "MyClientSecret" )
captions_data = "WEBVTT \n\n 00:00:00.000-- > 00:00:10.000 \n Caption text."
slides_api . create_video_caption_track ( "MyPresentation.pptx" , 3 , 1 , "Captions" , captions_data , "MyFolder" )
Node.js
Copy
const cloud = require ( "asposeslidescloud" );
const slidesApi = new cloud . SlidesApi ( "MyClientId" , "MyClientSecret" );
const captionsData = "WEBVTT\n\n00:00:00.000-- > 00:00:10.000\nCaption text." ;
slidesApi . createVideoCaptionTracks ( "MyPresentation.pptx" , 3 , 1 , "Captions" , captionsData , "MyFolder" );
C++
Copy
#include "asposeslidescloud/api/SlidesApi.h"
using namespace asposeslidescloud :: api ;
int main ()
{
auto slidesApi = new SlidesApi ( L "MyClientId" , L "MyClientSecret" );
auto captionsData = L "WEBVTT \n\n 00:00:00.000-- > 00:00:10.000 \n Caption text." ;
slidesApi -> createVideoCaptionTrack ( L "MyPresentation.pptx" , 3 , 1 , L "Captions" , captionsData , L "MyFolder" ). get ();
std :: cin . get ();
return 0 ;
}
Perl
Copy
use AsposeSlidesCloud::Configuration ;
use AsposeSlidesCloud::SlidesApi ;
my $config = AsposeSlidesCloud::Configuration -> new ();
$config -> { app_sid } = "MyClientId" ;
$config -> { app_key } = "MyClientSecret" ;
my $slides_api = AsposeSlidesCloud::SlidesApi -> new ( config => $config );
my $captions_data = "WEBVTT\n\n00:00:00.000-- > 00:00:10.000\nCaption text." ;
my %parameters = ( name => "MyPresentation.pptx" , slideIndex => 3 , shapeIndex => 1 , label => "Captions" , data => $captions_data , folder => "MyFolder" );
$slides_api -> create_video_caption_track ( %parameters );
Swift
Go
SDKs
Using an SDK (API client) is the quickest way for a developer to speed up development. An SDK takes care of a lot of low-level details of making requests and handling responses and lets you focus on writing code specific to your particular project. Check out our GitHub repository for a complete list of Aspose.Slides Cloud SDKs along with working examples, to get you started in no time. Please check Available SDKs article to learn how to add an SDK to your project.