Documentation ¶
Index ¶
- Constants
- type APIError
- type AddCustomHostnameInput
- type Client
- func (client *Client) AddCustomHostname(ctx context.Context, pullZone, hostname string) (err error)
- func (client *Client) CreateVideo(ctx context.Context, input CreateVideoInput) (output Video, err error)
- func (client *Client) DeleteVideo(ctx context.Context, libraryID, videoID string) (err error)
- func (client *Client) DownloadFile(ctx context.Context, input DownloadFileInput) (data io.ReadCloser, err error)
- func (client *Client) FetchVideo(ctx context.Context, libraryID, videoUrl string) (output FetchVideoOutput, err error)
- func (client *Client) GenerateIframeVideoUrl(libraryID string, videoID string, options *GenerateIframeVideoUrlOptions) (videoUrl string)
- func (client *Client) GetVideo(ctx context.Context, libraryID, videoID string) (video Video, err error)
- func (client *Client) LoadFreeCertificate(ctx context.Context, hostname string) (err error)
- func (client *Client) ReencodeVideo(ctx context.Context, libraryID, videoID string) (video Video, err error)
- func (client *Client) RemoveCustomHostname(ctx context.Context, pullZone, hostname string) (err error)
- func (client *Client) SignVideoUrl(videoId string, expiresAt time.Time) (token, expiresAtStr string)
- func (client *Client) UpdateVideo(ctx context.Context, input UpdateVideoInput) (err error)
- func (client *Client) UploadFile(ctx context.Context, input UploadFileInput) (err error)
- func (client *Client) UploadVideo(ctx context.Context, input UploadVideoInput) (output UploadVideoOutput, err error)
- type CreateVideoInput
- type DownloadFileInput
- type FetchVideoInput
- type FetchVideoOutput
- type GenerateIframeVideoUrlOptions
- type RemoveCustomHostnameInput
- type UpdateVideoInput
- type UploadFileInput
- type UploadVideoInput
- type UploadVideoOutput
- type Video
- type VideoChapter
- type VideoMetaTag
- type VideoMoment
- type VideoStatus
Constants ¶
View Source
const ( VideoStatusCreated = iota VideoStatusUploaded VideoStatusProcessing VideoStatusTranscoding // Video is ready VideoStatusFinished VideoStatusError VideoStatusUploadFailed )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddCustomHostnameInput ¶
type AddCustomHostnameInput struct {
Hostname string `json:"Hostname"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) AddCustomHostname ¶
func (*Client) CreateVideo ¶
func (*Client) DeleteVideo ¶
func (*Client) DownloadFile ¶
func (client *Client) DownloadFile(ctx context.Context, input DownloadFileInput) (data io.ReadCloser, err error)
See https://docs.bunny.net/reference/get_-storagezonename-path-filename
func (*Client) FetchVideo ¶
func (*Client) GenerateIframeVideoUrl ¶
func (client *Client) GenerateIframeVideoUrl(libraryID string, videoID string, options *GenerateIframeVideoUrlOptions) (videoUrl string)
GenerateIframeVideoUrl generates the URL of the given video to be embeded with an iframe See https://docs.bunny.net/docs/stream-embedding-videos for more information See https://docs.bunny.net/docs/stream-embed-token-authentication for documentation about authentication
func (*Client) GetVideo ¶
func (*Client) LoadFreeCertificate ¶
func (*Client) ReencodeVideo ¶
func (*Client) RemoveCustomHostname ¶
func (*Client) SignVideoUrl ¶
func (client *Client) SignVideoUrl(videoId string, expiresAt time.Time) (token, expiresAtStr string)
See https://docs.bunny.net/docs/stream-embed-token-authentication
func (*Client) UpdateVideo ¶
func (client *Client) UpdateVideo(ctx context.Context, input UpdateVideoInput) (err error)
func (*Client) UploadFile ¶
func (client *Client) UploadFile(ctx context.Context, input UploadFileInput) (err error)
See https://docs.bunny.net/reference/put_-storagezonename-path-filename
func (*Client) UploadVideo ¶
func (client *Client) UploadVideo(ctx context.Context, input UploadVideoInput) (output UploadVideoOutput, err error)
type CreateVideoInput ¶
type DownloadFileInput ¶
type FetchVideoInput ¶
type FetchVideoInput struct {
Url string `json:"url"`
}
type FetchVideoOutput ¶
type GenerateIframeVideoUrlOptions ¶
type GenerateIframeVideoUrlOptions struct { Signed bool // If Signed is true and Expires is nil we use a default value of 24 hours Expires *time.Time Autoplay *bool // We recommend to set to false TrackView *bool // We recommend to set to true Preload *bool Captions *string VideoStartTime *uint64 Refresh *bool }
See here for the avilable options: https://docs.bunny.net/docs/stream-embedding-videos#parameters
type RemoveCustomHostnameInput ¶
type RemoveCustomHostnameInput struct {
Hostname string `json:"Hostname"`
}
type UpdateVideoInput ¶
type UpdateVideoInput struct { LibraryID string `json:"-"` VideoID string `json:"-"` Title *string `json:"title,omitempty"` CollectionID *string `json:"collectionId,omitempty"` Chapters []VideoChapter `json:"chapters,omitempty"` Moments []VideoMoment `json:"moments,omitempty"` MetaTags []VideoMetaTag `json:"metaTags,omitempty"` }
type UploadFileInput ¶
type UploadVideoInput ¶
type UploadVideoOutput ¶
type Video ¶
type Video struct { VideoLibraryID int64 `json:"videoLibraryId"` Guid string `json:"guid"` Title string `json:"title"` // "dateUploaded": "2023-08-17T12:45:11.381", Views int64 `json:"views"` IsPublic bool `json:"isPublic"` // Length is the duration of the video in seconds Length int64 `json:"length"` Status VideoStatus `json:"status"` Framerate float64 `json:"framerate"` // "rotation": 0, Width int64 `json:"width"` Height int64 `json:"height"` // The available resolutions of the video. "360p,720p,1080p" for example AvailableResolutions string `json:"availableResolutions"` ThumbnailCount int64 `json:"thumbnailCount"` // The current encode progress of the video EncodeProgress int64 `json:"encodeProgress"` // The amount of storage used by this video StorageSize int64 `json:"storageSize"` // "captions": [], HasMP4Fallback bool `json:"hasMP4Fallback"` // The ID of the collection where the video belongs. Can be empty. CollectionID string `json:"collectionId"` // The file name of the thumbnail inside of the storage ThumbnailFileName string `json:"thumbnailFileName"` // The average watch time of the video in seconds AverageWatchTime int64 `json:"averageWatchTime"` // The total video watch time in seconds TotalWatchTime int64 `json:"totalWatchTime"` // The automatically detected category of the video. Default: "unknown" Category string `json:"category"` Chapters []VideoChapter `json:"chapters"` Moments []VideoMoment `json:"moments"` MetaTags []VideoMetaTag `json:"metaTags"` }
See https://docs.bunny.net/reference/video_getvideo for details
type VideoChapter ¶
type VideoMetaTag ¶
type VideoMoment ¶
type VideoStatus ¶
type VideoStatus int64
Click to show internal directories.
Click to hide internal directories.