Documentation ¶
Index ¶
- Variables
- type CallParams
- type CancelObjectRepresentation
- type Client
- func (c *Client) CancelTranscript(mediaFileID string, callParams CallParams) error
- func (c *Client) GetEditingLink(mediaFileID string, hoursUntilExpiration int, callParams CallParams) (string, error)
- func (c *Client) GetTranscriptInfo(mediaFileID string, callParams CallParams) (*TranscriptObjectRepresentation, error)
- func (c *Client) GetTranscriptText(mediaFileID, offset string, outputFormat types.CaptionsFormat, ...) (string, error)
- func (c *Client) OrderTranscript(mediaFileID, callbackURL, turnaroundLevel string, callParams CallParams) (*TranscriptObjectRepresentation, error)
- func (c *Client) UploadFileFromURL(options url.Values, callParams CallParams) (int, error)
- type Error
- type FileObjectRepresentation
- type ThreePlayError
- type ThreePlayFileResponse
- type ThreePlayTranscriptCancelResponse
- type ThreePlayTranscriptResponse
- type ThreePlayTranscriptTextResponse
- type TranscriptObjectRepresentation
Constants ¶
This section is empty.
Variables ¶
var ( errors.New("401: API Error") // ErrNotFound represents a 404 error on API ErrNotFound = errors.New("404: API Error") )ErrUnauthorized =
var TranscriptFormatToID = map[types.CaptionsFormat]int{ types.WebVTT: 139, types.SRT: 7, }
TranscriptFormatToID maps a caption format to their 3play code
Functions ¶
This section is empty.
Types ¶
type CallParams ¶ added in v0.3.2
type CallParams struct {
APIKey string `json:"api_key"`
}
CallParams contains the call params the caller wants to override
type CancelObjectRepresentation ¶
type CancelObjectRepresentation struct {
Success bool `json:"success"`
}
CancelObjectRepresentation represents the content of a cancel response
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 3Play Media API client
func NewClientWithHTTPClient ¶
NewClientWithHTTPClient returns a 3Play Media client with a custom http client
func (*Client) CancelTranscript ¶
func (c *Client) CancelTranscript(mediaFileID string, callParams CallParams) error
CancelTranscript cancels the transcript order if possible
func (*Client) GetEditingLink ¶ added in v0.3.1
func (c *Client) GetEditingLink(mediaFileID string, hoursUntilExpiration int, callParams CallParams) (string, error)
GetEditingLink gets an expiring editing link
func (*Client) GetTranscriptInfo ¶
func (c *Client) GetTranscriptInfo(mediaFileID string, callParams CallParams) (*TranscriptObjectRepresentation, error)
GetTranscriptInfo gets the status of the transcript job
func (*Client) GetTranscriptText ¶
func (c *Client) GetTranscriptText(mediaFileID, offset string, outputFormat types.CaptionsFormat, callParams CallParams) (string, error)
GetTranscriptText downloads the transcript in the specified format
func (*Client) OrderTranscript ¶
func (c *Client) OrderTranscript(mediaFileID, callbackURL, turnaroundLevel string, callParams CallParams) (*TranscriptObjectRepresentation, error)
OrderTranscript orders a transcript generation job
func (*Client) UploadFileFromURL ¶
UploadFileFromURL uploads a file to threeplay using the file's URL and returns the file ID.
type ThreePlayError ¶
ThreePlayError represents the content of a transcript error response
type ThreePlayFileResponse ¶
type ThreePlayFileResponse struct { Code int `json:"code"` Data FileObjectRepresentation `json:"data"` Error ThreePlayError `json:"error"` }
type ThreePlayTranscriptCancelResponse ¶
type ThreePlayTranscriptCancelResponse struct { Code int `json:"code"` Data CancelObjectRepresentation `json:"data"` Error ThreePlayError `json:"error"` }
ThreePlayTranscriptCancelResponse the cancel response object
type ThreePlayTranscriptResponse ¶
type ThreePlayTranscriptResponse struct { Code int `json:"code"` Data TranscriptObjectRepresentation `json:"data"` Error ThreePlayError `json:"error"` }
ThreePlayTranscriptResponse the info response object
type ThreePlayTranscriptTextResponse ¶
type ThreePlayTranscriptTextResponse struct { Code int `json:"code"` Data string `json:"data"` Error ThreePlayError `json:"error"` }
ThreePlayTranscriptTextResponse is the text of the transcript response
type TranscriptObjectRepresentation ¶
type TranscriptObjectRepresentation struct { ID int `json:"id"` MediaFileID int `json:"media_file_id"` Duration float64 `json:"duration"` Type string `json:"type"` LanguageID int `json:"language_id"` Status string `json:"status"` Cancellable bool `json:"cancellable"` CancellationReason string `json:"cancellation_reason"` CancellationDetails string `json:"cancellation_details"` }
TranscriptObjectRepresentation represents the content of a transcript info response