Documentation
¶
Index ¶
- type Account
- type AccountService
- type AccountServiceI
- type Assets
- type Caption
- type CaptionList
- type CaptionRequest
- type CaptionsService
- func (s *CaptionsService) Delete(videoID string, language string) error
- func (s *CaptionsService) Get(videoID string, language string) (*Caption, error)
- func (s *CaptionsService) List(videoID string) (*CaptionList, error)
- func (s *CaptionsService) Update(videoID string, language string, updateRequest *CaptionRequest) (*Caption, error)
- func (s *CaptionsService) Upload(videoID string, language string, filePath string) (*Caption, error)
- type CaptionsServiceI
- type Chapter
- type ChapterList
- type ChaptersService
- func (s *ChaptersService) Delete(videoID string, language string) error
- func (s *ChaptersService) Get(videoID string, language string) (*Chapter, error)
- func (s *ChaptersService) List(videoID string) (*ChapterList, error)
- func (s *ChaptersService) Upload(videoID string, language string, filePath string) (*Chapter, error)
- type ChaptersServiceI
- type Client
- type Device
- type Encoding
- type EncodingMetadata
- type ErrorResponse
- type Ingest
- type Link
- type Livestream
- type LivestreamList
- type LivestreamOpts
- type LivestreamRequest
- type LivestreamsService
- func (s *LivestreamsService) Create(createRequest *LivestreamRequest) (*Livestream, error)
- func (s *LivestreamsService) Delete(livestreamID string) error
- func (s *LivestreamsService) DeleteThumbnail(livestreamID string) (*Livestream, error)
- func (s *LivestreamsService) Get(livestreamID string) (*Livestream, error)
- func (s *LivestreamsService) List(opts *LivestreamOpts) (*LivestreamList, error)
- func (s *LivestreamsService) Update(livestreamID string, updateRequest *LivestreamRequest) (*Livestream, error)
- func (s *LivestreamsService) UploadThumbnail(livestreamID string, filePath string) (*Livestream, error)
- type LivestreamsServiceI
- type Location
- type Metadata
- type Os
- type Pagination
- type Player
- type PlayerAssets
- type PlayerList
- type PlayerOpts
- type PlayerRequest
- type PlayersService
- func (s *PlayersService) Create(createRequest *PlayerRequest) (*Player, error)
- func (s *PlayersService) Delete(playerID string) error
- func (s *PlayersService) DeleteLogo(playerID string) error
- func (s *PlayersService) Get(PlayerID string) (*Player, error)
- func (s *PlayersService) List(opts *PlayerOpts) (*PlayerList, error)
- func (s *PlayersService) Update(playerID string, updateRequest *PlayerRequest) (*Player, error)
- func (s *PlayersService) UploadLogo(playerID string, link string, filePath string) (*Player, error)
- type PlayersServiceI
- type Quality
- type Quota
- type ReceivedBytesItem
- type Referrer
- type SessClient
- type Session
- type SessionEvent
- type SessionEventList
- type SessionEventOpts
- type SessionLivestreamOpts
- type SessionVideoOpts
- type Source
- type Statistic
- type StatisticList
- type StatisticsService
- func (s *StatisticsService) GetLivestreamSessions(livestreamID string, opts *SessionLivestreamOpts) (*StatisticList, error)
- func (s *StatisticsService) GetSessionEvents(sessionID string, opts *SessionEventOpts) (*SessionEventList, error)
- func (s *StatisticsService) GetVideoSessions(videoID string, opts *SessionVideoOpts) (*StatisticList, error)
- type StatisticsServiceI
- type Token
- type UploadFileReader
- type UploadToken
- type UploadTokensService
- type UploadTokensServiceI
- type Video
- type VideoList
- type VideoLivestream
- type VideoOpts
- type VideoRequest
- type VideoStatus
- type VideosService
- func (s *VideosService) Create(createRequest *VideoRequest) (*Video, error)
- func (s *VideosService) Delete(videoID string) error
- func (s *VideosService) Get(videoID string) (*Video, error)
- func (s *VideosService) List(opts *VideoOpts) (*VideoList, error)
- func (s *VideosService) PickThumbnail(videoID string, timecode string) (*Video, error)
- func (s *VideosService) Status(videoID string) (*VideoStatus, error)
- func (s *VideosService) Update(videoID string, updateRequest *VideoRequest) (*Video, error)
- func (s *VideosService) Upload(videoID string, filePath string) (*Video, error)
- func (s *VideosService) UploadFromRequest(videoID string, file io.Reader, fileName string, fileSize int64, ...) (*Video, error)
- func (s *VideosService) UploadThumbnail(videoID string, filePath string) (*Video, error)
- type VideosServiceI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct {
Quota *Quota `json:"quota,omitempty"`
Features []string `json:"features,omitempty"`
}
Account represents an api.video Account
type AccountService ¶
type AccountService struct {
// contains filtered or unexported fields
}
AccountService communicating with the Account endpoints of the api.video API
func (*AccountService) Get ¶
func (s *AccountService) Get() (*Account, error)
Get returns an Account
type AccountServiceI ¶
AccountServiceI is an interface representing the Account endpoints of the api.video API See: https://docs.api.video/5.1/captions
type Assets ¶
type Assets struct {
Hls string `json:"hls,omitempty"`
Iframe string `json:"iframe,omitempty"`
Player string `json:"player,omitempty"`
Thumbnail string `json:"thumbnail,omitempty"`
Mp4 string `json:"mp4,omitempty"`
}
Assets represents Video assets
type Caption ¶
type Caption struct {
URI string `json:"uri,omitempty"`
Src string `json:"src,omitempty"`
Srclang string `json:"srclang,omitempty"`
Default bool `json:"default,omitempty"`
}
Caption represents an api.video Caption
type CaptionList ¶
type CaptionList struct {
Data []Caption `json:"data,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
CaptionList represents a list of captions
type CaptionRequest ¶
type CaptionRequest struct {
Default bool `json:"default"`
}
CaptionRequest represents a request to update a Caption
type CaptionsService ¶
type CaptionsService struct {
// contains filtered or unexported fields
}
CaptionsService communicating with the Captions endpoints of the api.video API
func (*CaptionsService) Delete ¶
func (s *CaptionsService) Delete(videoID string, language string) error
Delete a caption
func (*CaptionsService) Get ¶
func (s *CaptionsService) Get(videoID string, language string) (*Caption, error)
Get returns a Caption by video id and language
func (*CaptionsService) List ¶
func (s *CaptionsService) List(videoID string) (*CaptionList, error)
List returns a slice of Caption containing all captions for a videoId
func (*CaptionsService) Update ¶
func (s *CaptionsService) Update(videoID string, language string, updateRequest *CaptionRequest) (*Caption, error)
Update a video container and returns it
type CaptionsServiceI ¶
type CaptionsServiceI interface {
Get(videoID string, language string) (*Caption, error)
List(videoID string) (*CaptionList, error)
Upload(videoID string, language string, filepath string) (*Caption, error)
Update(videoID string, language string, updateRequest *CaptionRequest) (*Caption, error)
Delete(videoID string, language string) error
}
CaptionsServiceI is an interface representing the Captions endpoints of the api.video API See: https://docs.api.video/5.1/captions
type Chapter ¶
type Chapter struct {
URI string `json:"uri,omitempty"`
Src string `json:"src,omitempty"`
Language string `json:"language,omitempty"`
}
Chapter represents an api.video Chapter
type ChapterList ¶
type ChapterList struct {
Data []Chapter `json:"data,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
ChapterList represents a list of chapters
type ChaptersService ¶
type ChaptersService struct {
// contains filtered or unexported fields
}
ChaptersService communicating with the Chapters endpoints of the api.video API
func (*ChaptersService) Delete ¶
func (s *ChaptersService) Delete(videoID string, language string) error
Delete a chapter
func (*ChaptersService) Get ¶
func (s *ChaptersService) Get(videoID string, language string) (*Chapter, error)
Get returns a Chapter by video id and language
func (*ChaptersService) List ¶
func (s *ChaptersService) List(videoID string) (*ChapterList, error)
List returns a slice of Chapter containing all chapters for a videoId
type ChaptersServiceI ¶
type ChaptersServiceI interface {
Get(videoID string, language string) (*Chapter, error)
List(videoID string) (*ChapterList, error)
Upload(videoID string, language string, filepath string) (*Chapter, error)
Delete(videoID string, language string) error
}
ChaptersServiceI is an interface representing the Chapters endpoints of the api.video API See: https://docs.api.video/5.1/chapters
type Client ¶
type Client struct {
BaseURL *url.URL
APIKey string
Token *Token
Videos VideosServiceI
Livestreams LivestreamsServiceI
UploadTokens UploadTokensServiceI
Captions CaptionsServiceI
Chapters ChaptersServiceI
Players PlayersServiceI
Statistics StatisticsServiceI
Account AccountServiceI
// contains filtered or unexported fields
}
Client type handles communicating with the api.video API
func NewSandboxClient ¶
NewSandboxClient returns a new api.video API client for sandbox environment
type Device ¶
type Device struct {
Type string `json:"type,omitempty"`
Vendor string `json:"vendor,omitempty"`
Model string `json:"model,omitempty"`
}
Device represents a Device
type Encoding ¶
type Encoding struct {
Playable bool `json:"playable,omitempty"`
Qualities []Quality
Metadata *EncodingMetadata
}
Encoding represents the encoding status of one video
type EncodingMetadata ¶
type EncodingMetadata struct {
Width int `json:"width,omitempty"`
Height int `json:"height,omitempty"`
Bitrate int `json:"bitrate,omitempty"`
Duration int `json:"duration,omitempty"`
Framerate int `json:"framerate,omitempty"`
Samplerate int `json:"samplerate,omitempty"`
VideoCodec string `json:"videoCodec,omitempty"`
AudioCodec string `json:"audioCodec,omitempty"`
AspectRatio string `json:"aspectRatio,omitempty"`
}
EncodingMetadata represents a encoding metadata
type ErrorResponse ¶
type ErrorResponse struct {
Response *http.Response
Type string `json:"type"`
Title string `json:"title"`
Name string `json:"name"`
}
ErrorResponse contains an error from the api.video API
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Ingest ¶
type Ingest struct {
Status string `json:"status,omitempty"`
Filesize int `json:"filesize,omitempty"`
ReceivedBytes []ReceivedBytesItem `json:"receivedBytes,omitempty"`
}
Ingest represents the ingest status of one video
type Livestream ¶
type Livestream struct {
LivestreamID string `json:"liveStreamId,omitempty"`
Name string `json:"name,omitempty"`
StreamKey string `json:"streamKey,omitempty"`
Record bool `json:"record,omitempty"`
Assets *Assets `json:"assets,omitempty"`
PlayerID string `json:"playerId,omitempty"`
Broadcasting bool `json:"broadcasting,omitempty"`
}
Livestream represents an api.video Livestream
type LivestreamList ¶
type LivestreamList struct {
Data []Livestream `json:"data,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
LivestreamList represents a list of livestream
type LivestreamOpts ¶
type LivestreamOpts struct {
CurrentPage int `url:"currentPage,omitempty"`
PageSize int `url:"pageSize,omitempty"`
StreamKey string `url:"streamKey,omitempty"`
}
LivestreamOpts represents a query string to search on livestreams
type LivestreamRequest ¶
type LivestreamRequest struct {
Name string `json:"name,omitempty"`
Record bool `json:"record"`
PlayerID string `json:"playerId,omitempty"`
}
LivestreamRequest represents a request to create / update a Livestream
type LivestreamsService ¶
type LivestreamsService struct {
// contains filtered or unexported fields
}
LivestreamsService communicating with the Livestream endpoints of the api.video API
func (*LivestreamsService) Create ¶
func (s *LivestreamsService) Create(createRequest *LivestreamRequest) (*Livestream, error)
Create a livestream container and returns it
func (*LivestreamsService) Delete ¶
func (s *LivestreamsService) Delete(livestreamID string) error
Delete a livestream container
func (*LivestreamsService) DeleteThumbnail ¶
func (s *LivestreamsService) DeleteThumbnail(livestreamID string) (*Livestream, error)
DeleteThumbnail upload the thumbnail of a livestream
func (*LivestreamsService) Get ¶
func (s *LivestreamsService) Get(livestreamID string) (*Livestream, error)
Get returns a Livestream by id
func (*LivestreamsService) List ¶
func (s *LivestreamsService) List(opts *LivestreamOpts) (*LivestreamList, error)
List returns a LivestreamList containing all livestreams
func (*LivestreamsService) Update ¶
func (s *LivestreamsService) Update(livestreamID string, updateRequest *LivestreamRequest) (*Livestream, error)
Update a video container and returns it
func (*LivestreamsService) UploadThumbnail ¶
func (s *LivestreamsService) UploadThumbnail(livestreamID string, filePath string) (*Livestream, error)
UploadThumbnail upload the thumbnail of a livestream
type LivestreamsServiceI ¶
type LivestreamsServiceI interface {
Get(livestreamID string) (*Livestream, error)
List(opts *LivestreamOpts) (*LivestreamList, error)
Create(createRequest *LivestreamRequest) (*Livestream, error)
Update(livestreamID string, updateRequest *LivestreamRequest) (*Livestream, error)
Delete(livestreamID string) error
UploadThumbnail(livestreamID string, filePath string) (*Livestream, error)
DeleteThumbnail(livestreamID string) (*Livestream, error)
}
LivestreamsServiceI is an interface representing the Videos endpoints of the api.video API See: https://docs.api.video/5.1/live
type Location ¶
type Location struct {
Country string `json:"country,omitempty"`
City string `json:"city,omitempty"`
}
Location represents a Location
type Os ¶
type Os struct {
Name string `json:"name,omitempty"`
Shortname string `json:"shortname,omitempty"`
Version string `json:"version,omitempty"`
}
Os represents a Os
type Pagination ¶
type Pagination struct {
CurrentPage int `json:"currentPage,omitempty"`
PageSize int `json:"pageSize,omitempty"`
PagesTotal int `json:"pagesTotal,omitempty"`
ItemsTotal int `json:"itemsTotal,omitempty"`
CurrentPageItems int `json:"currentPageItems,omitempty"`
Links []Link `json:"links,omitempty"`
}
Pagination represents a pagination object
type Player ¶
type Player struct {
PlayerID string `json:"playerId,omitempty"`
ShapeMargin int `json:"shapeMargin,omitempty"`
ShapeRadius int `json:"shapeRadius,omitempty"`
ShapeAspect string `json:"shapeAspect,omitempty"`
ShapeBackgroundTop string `json:"shapeBackgroundTop,omitempty"`
ShapeBackgroundBottom string `json:"shapeBackgroundBottom,omitempty"`
Text string `json:"text,omitempty"`
Link string `json:"link,omitempty"`
LinkHover string `json:"linkHover,omitempty"`
LinkActive string `json:"linkActive,omitempty"`
TrackPlayed string `json:"trackPlayed,omitempty"`
TrackUnplayed string `json:"trackUnplayed,omitempty"`
TrackBackground string `json:"trackBackground,omitempty"`
BackgroundTop string `json:"backgroundTop,omitempty"`
BackgroundBottom string `json:"backgroundBottom,omitempty"`
BackgroundText string `json:"backgroundText,omitempty"`
EnableAPI bool `json:"enableApi,omitempty"`
EnableControls bool `json:"enableControls,omitempty"`
ForceAutoplay bool `json:"forceAutoplay,omitempty"`
HideTitle bool `json:"hideTitle,omitempty"`
ForceLoop bool `json:"forceLoop,omitempty"`
Assets *PlayerAssets `json:"assets,omitempty"`
}
Player represents an api.video Player
type PlayerAssets ¶
type PlayerAssets struct {
Logo string `json:"logo,omitempty"`
Link string `json:"link,omitempty"`
}
PlayerAssets represents ths assets of a Player
type PlayerList ¶
type PlayerList struct {
Data []Player `json:"data,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
PlayerList represents a list of player
type PlayerOpts ¶
type PlayerOpts struct {
CurrentPage int `url:"currentPage,omitempty"`
PageSize int `url:"pageSize,omitempty"`
}
PlayerOpts represents a query string to search on players
type PlayerRequest ¶
type PlayerRequest struct {
ShapeMargin int `json:"shapeMargin,omitempty"`
ShapeRadius int `json:"shapeRadius,omitempty"`
ShapeAspect string `json:"shapeAspect,omitempty"`
ShapeBackgroundTop string `json:"shapeBackgroundTop,omitempty"`
ShapeBackgroundBottom string `json:"shapeBackgroundBottom,omitempty"`
Text string `json:"text,omitempty"`
Link string `json:"link,omitempty"`
LinkHover string `json:"linkHover,omitempty"`
LinkActive string `json:"linkActive,omitempty"`
TrackPlayed string `json:"trackPlayed,omitempty"`
TrackUnplayed string `json:"trackUnplayed,omitempty"`
TrackBackground string `json:"trackBackground,omitempty"`
BackgroundTop string `json:"backgroundTop,omitempty"`
BackgroundBottom string `json:"backgroundBottom,omitempty"`
BackgroundText string `json:"backgroundText,omitempty"`
EnableAPI bool `json:"enableApi"`
EnableControls bool `json:"enableControls"`
ForceAutoplay bool `json:"forceAutoplay"`
HideTitle bool `json:"hideTitle"`
ForceLoop bool `json:"forceLoop"`
}
PlayerRequest represents a request to create / update a Player
type PlayersService ¶
type PlayersService struct {
// contains filtered or unexported fields
}
PlayersService communicating with the Players endpoints of the api.video API
func (*PlayersService) Create ¶
func (s *PlayersService) Create(createRequest *PlayerRequest) (*Player, error)
Create a player and returns it
func (*PlayersService) Delete ¶
func (s *PlayersService) Delete(playerID string) error
Delete a player
func (*PlayersService) DeleteLogo ¶
func (s *PlayersService) DeleteLogo(playerID string) error
DeleteLogo delete a player logo
func (*PlayersService) Get ¶
func (s *PlayersService) Get(PlayerID string) (*Player, error)
Get returns a Player by id
func (*PlayersService) List ¶
func (s *PlayersService) List(opts *PlayerOpts) (*PlayerList, error)
List returns a PlayerList containing all players
func (*PlayersService) Update ¶
func (s *PlayersService) Update(playerID string, updateRequest *PlayerRequest) (*Player, error)
Update a player and returns it
func (*PlayersService) UploadLogo ¶
UploadLogo upload the logo of a player
type PlayersServiceI ¶
type PlayersServiceI interface {
Get(playerID string) (*Player, error)
List(opts *PlayerOpts) (*PlayerList, error)
Create(createRequest *PlayerRequest) (*Player, error)
Update(playerID string, updateRequest *PlayerRequest) (*Player, error)
Delete(playerID string) error
UploadLogo(playerID string, link string, filepath string) (*Player, error)
DeleteLogo(playerID string) error
}
PlayersServiceI is an interface representing the Players endpoints of the api.video API See: https://docs.api.video/5.1/players
type Quality ¶
type Quality struct {
Quality string `json:"quality,omitempty"`
Status string `json:"status,omitempty"`
}
Quality represents a quality
type Quota ¶
type Quota struct {
QuotaUsed int `json:"quotaUsed,omitempty"`
QuotaRemaining int `json:"quotaRemaining,omitempty"`
QuotaTotal int `json:"quotaTotal,omitempty"`
}
Quota represents a Quota
type ReceivedBytesItem ¶
type ReceivedBytesItem struct {
To int `json:"to,omitempty"`
From int `json:"from,omitempty"`
Total int `json:"total,omitempty"`
}
ReceivedBytesItem represents a received bytes item
type Referrer ¶
type Referrer struct {
URL string `json:"url,omitempty"`
Medium string `json:"medium,omitempty"`
Source string `json:"source,omitempty"`
SearchTerm string `json:"searchTerm,omitempty"`
}
Referrer represents a Referrer
type SessClient ¶
type SessClient struct {
Type string `json:"type,omitempty"`
Name string `json:"name,omitempty"`
Version string `json:"version,omitempty"`
}
SessClient represents a SessClient
type Session ¶
type Session struct {
SessionID string `json:"sessionId,omitempty"`
LoadedAt string `json:"loadedAt,omitempty"`
EndedAt string `json:"endedAt,omitempty"`
Metadata map[string]string `json:"metadata,omitempty"`
}
Session represents a Session
type SessionEvent ¶
type SessionEvent struct {
Type string `json:"type,omitempty"`
EmittedAt string `json:"emittedAt,omitempty"`
At int `json:"at,omitempty"`
From int `json:"from,omitempty"`
To int `json:"to,omitempty"`
}
SessionEvent represents a SessionEvent
type SessionEventList ¶
type SessionEventList struct {
Data []SessionEvent `json:"data,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
SessionEventList represents a SessionEventList
type SessionEventOpts ¶
type SessionEventOpts struct {
CurrentPage int `url:"currentPage,omitempty"`
PageSize int `url:"pageSize,omitempty"`
}
SessionEventOpts represents a query string to search on sessions
type SessionLivestreamOpts ¶
type SessionLivestreamOpts struct {
CurrentPage int `url:"currentPage,omitempty"`
PageSize int `url:"pageSize,omitempty"`
Period string `url:"period,omitempty"`
}
SessionLivestreamOpts represents a query string to search on livestream statistics
type SessionVideoOpts ¶
type SessionVideoOpts struct {
CurrentPage int `url:"currentPage,omitempty"`
PageSize int `url:"pageSize,omitempty"`
Period string `url:"period,omitempty"`
Metadata map[string]string `url:"-"`
}
SessionVideoOpts represents a query string to search on videos statistics
type Source ¶
type Source struct {
URI string `json:"uri,omitempty"`
Type string `json:"type,omitempty"`
Livestream *VideoLivestream `json:"livestream,omitempty"`
}
Source represents a Video source
type Statistic ¶
type Statistic struct {
Session *Session `json:"session,omitempty"`
Location *Location `json:"location,omitempty"`
Referrer *Referrer `json:"referrer,omitempty"`
Device *Device `json:"device,omitempty"`
Os *Os `json:"os,omitempty"`
SessClient *SessClient `json:"client,omitempty"`
}
Statistic represents a Statistic
type StatisticList ¶
type StatisticList struct {
Data []Statistic `json:"data,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
StatisticList represents a list of staticics
type StatisticsService ¶
type StatisticsService struct {
// contains filtered or unexported fields
}
StatisticsService communicating with the Statistics endpoints of the api.video API
func (*StatisticsService) GetLivestreamSessions ¶
func (s *StatisticsService) GetLivestreamSessions(livestreamID string, opts *SessionLivestreamOpts) (*StatisticList, error)
GetLivestreamSessions returns a StatisticList containing all sessions for a video
func (*StatisticsService) GetSessionEvents ¶
func (s *StatisticsService) GetSessionEvents(sessionID string, opts *SessionEventOpts) (*SessionEventList, error)
GetSessionEvents returns a StatisticList containing all stats for one session
func (*StatisticsService) GetVideoSessions ¶
func (s *StatisticsService) GetVideoSessions(videoID string, opts *SessionVideoOpts) (*StatisticList, error)
GetVideoSessions returns a StatisticList containing all sessions for a video
type StatisticsServiceI ¶
type StatisticsServiceI interface {
GetVideoSessions(videoID string, opts *SessionVideoOpts) (*StatisticList, error)
GetLivestreamSessions(LivestreamID string, opts *SessionLivestreamOpts) (*StatisticList, error)
GetSessionEvents(SessionID string, opts *SessionEventOpts) (*SessionEventList, error)
}
StatisticsServiceI is an interface representing the Players endpoints of the api.video API See: https://docs.api.video/5.1/players
type Token ¶
type Token struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
RefreshToken string `json:"refresh_token"`
ExpiresIn int `json:"expires_in"`
ExpireTime time.Time
}
Token contains token for connecting to the api.video API
type UploadFileReader ¶
type UploadFileReader struct {
// contains filtered or unexported fields
}
type UploadToken ¶
type UploadToken struct {
Token string `json:"token,omitempty"`
}
UploadToken represents an api.video UploadToken
type UploadTokensService ¶
type UploadTokensService struct {
// contains filtered or unexported fields
}
UploadTokensService communicating with the Upload Tokens endpoints of the api.video API
func (*UploadTokensService) Generate ¶
func (s *UploadTokensService) Generate() (*UploadToken, error)
Generate returns a new generated UploadToken
type UploadTokensServiceI ¶
type UploadTokensServiceI interface {
Generate() (*UploadToken, error)
}
UploadTokensServiceI is an interface representing the Upload Tokens endpoints of the api.video API See: https://docs.api.video/5.1/videos-delegated-upload
type Video ¶
type Video struct {
VideoID string `json:"videoId,omitempty"`
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
PublishedAt string `json:"publishedAt,omitempty"`
UpdatedAt string `json:"updatedAt,omitempty"`
Tags []string `json:"tags,omitempty"`
Metadata []Metadata `json:"metadata,omitempty"`
Source *Source `json:"source,omitempty"`
Assets *Assets `json:"assets,omitempty"`
PlayerID string `json:"playerId,omitempty"`
Public bool `json:"public,omitempty"`
Panoramic bool `json:"panoramic,omitempty"`
Mp4Support bool `json:"mp4Support,omitempty"`
}
Video represents an api.video Video
type VideoList ¶
type VideoList struct {
Data []Video `json:"data,omitempty"`
Pagination *Pagination `json:"pagination,omitempty"`
}
VideoList represents a list of videos
type VideoLivestream ¶
type VideoLivestream struct {
LivestreamID string `json:"livestreamId,omitempty"`
Links []Link `json:"links,omitempty"`
}
VideoLivestream represents a Video livestream
type VideoOpts ¶
type VideoOpts struct {
CurrentPage int `url:"currentPage,omitempty"`
PageSize int `url:"pageSize,omitempty"`
SortBy string `url:"sortBy,omitempty"`
SortOrder string `url:"sortOrder,omitempty"`
Title string `url:"title,omitempty"`
Tags []string `url:"tags,brackets,omitempty"`
Description string `url:"description,omitempty"`
LivestreamID string `url:"livestreamId,omitempty"`
Metadata map[string]string `url:"-"`
}
VideoOpts represents a query string to search on videos
type VideoRequest ¶
type VideoRequest struct {
Title string `json:"title,omitempty"`
Description string `json:"description,omitempty"`
Tags []string `json:"tags,omitempty"`
Metadata []Metadata `json:"metadata,omitempty"`
Source string `json:"source,omitempty"`
PlayerID string `json:"playerId,omitempty"`
Public bool `json:"public,omitempty"`
Panoramic bool `json:"panoramic"`
Mp4Support bool `json:"mp4Support"`
}
VideoRequest represents a request to create / update a Video
type VideoStatus ¶
type VideoStatus struct {
Ingest *Ingest `json:"ingest,omitempty"`
Encoding *Encoding `json:"encoding,omitempty"`
}
VideoStatus represents the encoding status of one video
type VideosService ¶
type VideosService struct {
// contains filtered or unexported fields
}
VideosService communicating with the Videos endpoints of the api.video API
func (*VideosService) Create ¶
func (s *VideosService) Create(createRequest *VideoRequest) (*Video, error)
Create a video container and returns it
func (*VideosService) Delete ¶
func (s *VideosService) Delete(videoID string) error
Delete a video container
func (*VideosService) Get ¶
func (s *VideosService) Get(videoID string) (*Video, error)
Get returns a Video by id
func (*VideosService) List ¶
func (s *VideosService) List(opts *VideoOpts) (*VideoList, error)
List returns a VideoList containing all videos matching VideoOpts
func (*VideosService) PickThumbnail ¶
func (s *VideosService) PickThumbnail(videoID string, timecode string) (*Video, error)
PickThumbnail change the thumbnail of a video with a timecode
func (*VideosService) Status ¶
func (s *VideosService) Status(videoID string) (*VideoStatus, error)
Status returns the status of encoding and ingest of a video
func (*VideosService) Update ¶
func (s *VideosService) Update(videoID string, updateRequest *VideoRequest) (*Video, error)
Update a video container and returns it
func (*VideosService) Upload ¶
func (s *VideosService) Upload(videoID string, filePath string) (*Video, error)
Upload a video in a container. The upload is chuncked if the file size is more than 128MB
func (*VideosService) UploadFromRequest ¶
func (*VideosService) UploadThumbnail ¶
func (s *VideosService) UploadThumbnail(videoID string, filePath string) (*Video, error)
UploadThumbnail upload the thumbnail of a video
type VideosServiceI ¶
type VideosServiceI interface {
Get(videoID string) (*Video, error)
List(opts *VideoOpts) (*VideoList, error)
Create(createRequest *VideoRequest) (*Video, error)
Update(videoID string, updateRequest *VideoRequest) (*Video, error)
Delete(videoID string) error
Upload(videoID string, filePath string) (*Video, error)
UploadFromRequest(videoID string, file io.Reader, fileName string, fileSize int64, ctx context.Context) (*Video, error)
Status(videoID string) (*VideoStatus, error)
PickThumbnail(videoID string, timecode string) (*Video, error)
UploadThumbnail(videoID string, filePath string) (*Video, error)
}
VideosServiceI is an interface representing the Videos endpoints of the api.video API See: https://docs.api.video/5.1/videos