streamable

package module
v0.0.0-...-991ad1d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2019 License: MIT Imports: 8 Imported by: 0

README

streamable-go

Build Status Go Report Card

streamable-go is a Go wrapper for working with Streamable's API

Use of this library is subject to Streamable's Terms of Service

Installation

go get github.com/fgoyer/streamable-go

Usage

To initialize a streamable client:

// Streamable utilizes Basic Authentication
streamable := New(email, password)

To retrieve a video, pass the known 5 character shortcode or streamable url.

video, _ := streamable.GetVideoFromShortcode("...")

videoEmbed, _ := streamable.GetVideoFromURL("https://streamable.com/...")

To import a video, pass a url:

result, _ := streamable.Import("...")

To upload a video, pass the path:

result, _ := streamable.Upload("...")

Important Note

All functionality and naming is subject to non-passive changes.

Acknowledgements

The structure of this api wrapper is heavily inspired by zmb3/spotify.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Status    int    `json:"status"`
	Shortcode string `json:"shortcode"`
}

Result contains the response of a video import or upload request.

type Streamable

type Streamable struct {
	// contains filtered or unexported fields
}

Streamable is a client for working with the Streamable Web API TODO document these fields

func New

func New(email string, pass string) *Streamable

New creates a Streamable Client that will use the specified email and password for its API requests.

func (*Streamable) GetVideoFromShortcode

func (c *Streamable) GetVideoFromShortcode(shortcode string) (*Video, error)

GetVideoFromShortcode retrieves the raw mp4 video files using the specified Streamable video shortcode.

func (*Streamable) GetVideoFromURL

func (c *Streamable) GetVideoFromURL(url string) (*VideoEmbed, error)

GetVideoFromURL retrieves the video embed information using the specified Streamable URL.

func (*Streamable) Import

func (c *Streamable) Import(videoURL string) (*Result, error)

Import uses the specified video url to import a video to Streamable.

func (*Streamable) Upload

func (c *Streamable) Upload(path string) (*Result, error)

Upload uses the specified path to upload a video to Streamable.

type Video

type Video struct {
	Status int `json:"status"`
	Files  struct {
		Mp4       mp4 `json:"mp4"`
		Mp4Mobile mp4 `json:"mp4-mobile"`
	} `json:"files"`
	EmbedCode    string `json:"embed_code"`
	Source       string `json:"source"`
	ThumbnailURL string `json:"thumbnail_url"`
	URL          string `json:"url"`
	Message      string `json:"message"`
	Title        string `json:"title"`
	Percent      int    `json:"percent"`
}

Video contains file information and metadata about a video.

type VideoEmbed

type VideoEmbed struct {
	ProviderURL  string `json:"provider_url"`
	HTML         string `json:"html"`
	Version      string `json:"version"`
	Title        string `json:"title"`
	Type         string `json:"type"`
	ProviderName string `json:"provider_name"`
	ThumbnailURL string `json:"thumbnail_url"`
	Width        int    `json:"width"`
	Height       int    `json:"height"`
}

VideoEmbed contains the embed code and metadata about a video.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL