Media Styles
Media Styles
This note explains the usage of the stream
, image
, and video
functions in Larupload.
The stream
function is used to create an HTTP Live Streaming (HLS) stream, which is a video streaming protocol that breaks the video into smaller segments and delivers them over HTTP. The image
and video
functions are used to manipulate images and videos, respectively.
When you want to create an HLS stream for a video, you can use the stream
function available in the Attachment
class of the attachments
method within their model. This function takes some arguments that specify the stream's resolution, bitrate, and other properties.
On the other hand, if you want to manipulate images or videos, you should use the image
and video
functions, respectively. These functions provide a set of options for resizing, cropping, and modifying the image or video.
Image Style
Index | Name | Type | Required | Default | Description |
---|---|---|---|---|---|
1 | name | string | – | style name. examples: thumbnail, small, ... | |
2 | width | ?int | null | width of the manipulated image | |
3 | height | ?int | null | height of the manipulated image | |
4 | mode | LaruploadMediaStyle | AUTO | this argument specifies how Larupload should manipulate the uploaded image and can take on any of the following values: |
Video Style
Index | Name | Type | Required | Default | Description |
---|---|---|---|---|---|
1 | name | string | – | style name. examples: thumbnail, small, ... | |
2 | width | ?int | null | width of the manipulated video | |
3 | height | ?int | null | height of the manipulated video | |
4 | mode | LaruploadMediaStyle | SCALE_HEIGHT | this argument specifies how Larupload should manipulate the uploaded video and can take on any of the following values: | |
5 | format | X264 | new X264 | by default, the encoding format for video is | |
6 | padding | bool | false | If set to |
Stream Style
Index | Name | Type | Required | Default | Description |
---|---|---|---|---|---|
1 | name | string | – | label for stream quality. highly recommended to use string labels like | |
2 | width | int | – | ||
3 | height | int | – | ||
4 | format | X264 | – | by default, the encoding format for video is | |
5 | padding | bool | false | If set to |
Last updated