@@ -27,6 +27,8 @@ export type ITranscodeAction = BitRateAction
2727 * <b>Learn more:</b> {@link https://cloudinary.com/documentation/video_manipulation_and_delivery#transcoding_video_to_other_formats | Transcoding video to other formats}
2828 * @memberOf Actions
2929 * @namespace Transcode
30+ * @example
31+ * // See examples under each method
3032 */
3133
3234/**
@@ -36,7 +38,17 @@ export type ITranscodeAction = BitRateAction
3638 *
3739 * <b>Learn more</b>: {@link https://cloudinary.com/documentation/audio_transformations#audio_frequency_control | Audio frequency control}
3840 * @param {string|number } freq The audio frequency.
39- * @return {AudioFrequencyAction }
41+ * @example
42+ * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
43+ * import {FREQ11025} from '@cloudinary/base/qualifiers/audioFrequency'
44+ * import {audioFrequency} from '@cloudinary/base/actions/transcode'
45+ *
46+ * const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
47+ * const video = yourCldInstance.video('dog');
48+ *
49+ * video.transcode(audioFrequency(FREQ11025()))
50+ * @return {Actions.Transcode.AudioFrequencyAction }
51+ *
4052 */
4153function audioFrequency ( freq : string | number ) : AudioFrequencyAction {
4254 return new AudioFrequencyAction ( freq ) ;
@@ -46,7 +58,16 @@ function audioFrequency(freq: string|number): AudioFrequencyAction{
4658 * @memberOf Actions.Transcode
4759 * @description Sets the audio codec or removes the audio channel.
4860 * @param {string } codec The audio codec or "none".
49- * @return {AudioCodecAction }
61+ * @example
62+ * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
63+ * import {aac} from '@cloudinary/base/qualifiers/audioCodec'
64+ * import {audioCodec} from '@cloudinary/base/actions/transcode'
65+ *
66+ * const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
67+ * const video = yourCldInstance.video('dog');
68+ *
69+ * video.transcode( audioCodec( aac() ) );
70+ * @return {Actions.Transcode.AudioCodecAction }
5071 */
5172function audioCodec ( codec : string ) : AudioCodecAction {
5273 return new AudioCodecAction ( codec ) ;
@@ -64,7 +85,14 @@ function audioCodec(codec: string): AudioCodecAction{
6485 * uses a variable bitrate (VBR), with this value indicating the maximum bitrate.
6586 * The value can be an integer e.g. 120000, or a string supporting "k" and "m"
6687 * (kilobits and megabits respectively) e.g. 250k or 2m.
67- * @return {BitRateAction }
88+ * @example
89+ * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
90+ * import {bitRate} from '@cloudinary/base/actions/transcode'
91+ * const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
92+ * const video = yourCldInstance.video('dog');
93+ *
94+ * video.transcode( bitRate(500).constant() );
95+ * @return {Actions.Transcode.BitRateAction }
6896 */
6997function bitRate ( bitRate : string | number ) : BitRateAction {
7098 return new BitRateAction ( bitRate ) ;
@@ -74,7 +102,15 @@ function bitRate(bitRate: string|number): BitRateAction {
74102 * @summary action
75103 * @memberOf Actions.Transcode
76104 * @param {number } from frame rate
77- * @return {FPSAction }
105+ * @example
106+ * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
107+ * import {fps} from '@cloudinary/base/actions/transcode'
108+ *
109+ * const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
110+ * const video = yourCldInstance.video('dog');
111+ *
112+ * video.transcode( fps(15) );
113+ * @return {Actions.Transcode.FPSAction }
78114 */
79115function fps ( from : number ) : FPSAction {
80116 return new FPSAction ( from ) ;
@@ -87,7 +123,15 @@ function fps(from: number): FPSAction {
87123 * delivered with an expected FPS level (helps with sync to audio).
88124 * @param {number } from frame rate
89125 * @param {number } to frame rate
90- * @return {FPSRangeAction }
126+ * @example
127+ * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
128+ * import {fpsRange} from '@cloudinary/base/actions/transcode'
129+ *
130+ * const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
131+ * const video = yourCldInstance.video('dog');
132+ *
133+ * video.transcode( fpsRange( 20, 25 ) );
134+ * @return {Actions.Transcode.FPSRangeAction }
91135 */
92136function fpsRange ( from : number , to ?: number ) : FPSRangeAction {
93137 return new FPSRangeAction ( from , to ) ;
@@ -98,7 +142,15 @@ function fpsRange(from: number, to?: number): FPSRangeAction {
98142 * @memberOf Actions.Transcode
99143 * @description Sets the keyframe interval of the delivered video.
100144 * @param {number | string } interval The keyframe interval in seconds.
101- * @return {KeyframeIntervalsAction }
145+ * @example
146+ * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
147+ * import {keyframeInterval} from '@cloudinary/base/actions/transcode'
148+ *
149+ * const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
150+ * const video = yourCldInstance.video('dog');
151+ *
152+ * video.transcode( keyframeInterval( 0.5 ) );
153+ * @return {Actions.Transcode.KeyframeIntervalsAction }
102154 */
103155function keyframeInterval ( interval : number | string ) : KeyframeIntervalsAction {
104156 return new KeyframeIntervalsAction ( interval ) ;
@@ -112,7 +164,16 @@ function keyframeInterval(interval: number | string): KeyframeIntervalsAction {
112164 * You can use the streaming profiles methods of StreamingProfilesTrait to get a list of the available streaming
113165 * profiles or to create new custom profiles.
114166 * @param {string } profile The streaming profile.
115- * @return {StreamingProfileAction }
167+ * @example
168+ * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
169+ * import {fullHd} from "@cloudinary/base/qualifiers/streamingProfile";
170+ * import {streamingProfile} from '@cloudinary/base/actions/transcode'
171+ *
172+ * const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
173+ * const video = yourCldInstance.video('dog');
174+ *
175+ * video.transcode( streamingProfile( fullHd() ) );
176+ * @return {Actions.Transcode.StreamingProfileAction }
116177 */
117178function streamingProfile ( profile : string ) : StreamingProfileAction {
118179 return new StreamingProfileAction ( profile ) ;
@@ -123,7 +184,16 @@ function streamingProfile(profile: string): StreamingProfileAction {
123184 * @memberOf Actions.Transcode
124185 * @description Converts a video to animated image.
125186 * @param {string } animatedFormat The streaming profile.
126- * @return {ToAnimatedAction }
187+ * @example
188+ * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
189+ * import {gif} from '@cloudinary/base/qualifiers/animatedFormat'
190+ * import {toAnimated} from '@cloudinary/base/actions/transcode'
191+ *
192+ * const yourCldInstance = new Cloudinary({cloud:{cloudName:'demo'}});
193+ * const video = yourCldInstance.video('dog');
194+ *
195+ * video.transcode( toAnimated( gif() ) );
196+ * @return {Actions.Transcode.ToAnimatedAction }
127197 */
128198function toAnimated ( animatedFormat : AnimatedFormatQualifierValue | string ) : ToAnimatedAction {
129199 return new ToAnimatedAction ( animatedFormat ) ;
@@ -134,7 +204,7 @@ function toAnimated(animatedFormat: AnimatedFormatQualifierValue | string): ToAn
134204 * @memberOf Actions.Transcode
135205 * @description Controls the video codec.
136206 * @param {Qualifiers.VideoCodec.VideoCodecType | Qualifiers.VideoCodec.AdvVideoCodecType } videoCodecType CodecType
137- * @example // Setting the video codec
207+ * @example
138208 * import {Cloudinary} from "@cloudinary/base/instance/Cloudinary";
139209 * import {vp9} from '@cloudinary/base/qualifiers/videoCodec'
140210 * import {videoCodec} from '@cloudinary/base/actions/transcode'
0 commit comments