videoproviders

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package videoproviders is a telly internal package to provide video stream information.

Index

Constants

View Source
const (
	// LiveStream is the constant describing a live stream.
	LiveStream ChannelType = "live"
	// VODStream is the constant describing a video on demand stream.
	VODStream = "vod"
	// SeriesStream is the constant describing a TV series stream.
	SeriesStream = "series"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Category

type Category struct {
	Name string `json:"name"`
	Type string `json:"type"`
}

Category describes a grouping of streams.

type Channel

type Channel struct {
	Name     string
	StreamID int
	Type     ChannelType
	Category string
	EPGID    string
	// contains filtered or unexported fields
}

Channel describes a channel available in the providers lineup with necessary pieces parsed into fields.

type ChannelType

type ChannelType string

ChannelType is used for enumerating the ChannelType field in Channel.

type Configuration

type Configuration struct {
	Name     string `json:"-"`
	Provider string

	// Only used for Xtream provider
	Username string
	Password string
	BaseURL  string

	// Only used for M3U provider
	M3UURL      string
	NameKey     string
	LogoKey     string
	CategoryKey string
	EPGIDKey    string
}

Configuration is the basic configuration struct for videoproviders with generic values for specific providers.

func (*Configuration) GetProvider

func (i *Configuration) GetProvider() (VideoProvider, error)

GetProvider returns an initialized VideoProvider for the Configuration.

type M3U

type M3U struct {
	BaseConfig Configuration

	Playlist *m3uplus.Playlist
	// contains filtered or unexported fields
}

M3U is a VideoProvider supporting M3U files.

func (*M3U) Categories

func (m *M3U) Categories() ([]Category, error)

Categories returns a slice of Category that the provider has available.

func (*M3U) Channels

func (m *M3U) Channels() ([]Channel, error)

Channels returns a slice of Channel that the provider has available.

func (*M3U) Configuration

func (m *M3U) Configuration() Configuration

Configuration returns the base configuration backing the provider

func (*M3U) Formats

func (m *M3U) Formats() ([]string, error)

Formats returns a slice of strings containing the valid video formats.

func (*M3U) Name

func (m *M3U) Name() string

Name returns the name of the VideoProvider.

func (*M3U) Refresh

func (m *M3U) Refresh() error

Refresh causes the provider to request the latest information.

func (*M3U) StreamURL

func (m *M3U) StreamURL(streamID int, wantedFormat string) (string, error)

StreamURL returns a fully formed URL to a video stream for the given streamID and wantedFormat.

type VideoProvider

type VideoProvider interface {
	Name() string
	Categories() ([]Category, error)
	Formats() ([]string, error)
	Channels() ([]Channel, error)
	StreamURL(streamID int, wantedFormat string) (string, error)

	Refresh() error
	Configuration() Configuration
}

VideoProvider describes a IPTV provider configuration.

type XtreamCodes

type XtreamCodes struct {
	BaseConfig Configuration
	// contains filtered or unexported fields
}

XtreamCodes is a VideoProvider supporting Xtream-Codes IPTV servers.

func (*XtreamCodes) Categories

func (x *XtreamCodes) Categories() ([]Category, error)

Categories returns a slice of Category that the provider has available.

func (*XtreamCodes) Channels

func (x *XtreamCodes) Channels() ([]Channel, error)

Channels returns a slice of Channel that the provider has available.

func (*XtreamCodes) Configuration

func (x *XtreamCodes) Configuration() Configuration

Configuration returns the base configuration backing the provider

func (*XtreamCodes) Formats

func (x *XtreamCodes) Formats() ([]string, error)

Formats returns a slice of strings containing the valid video formats.

func (*XtreamCodes) Name

func (x *XtreamCodes) Name() string

Name returns the name of the VideoProvider.

func (*XtreamCodes) Refresh

func (x *XtreamCodes) Refresh() error

Refresh causes the provider to request the latest information.

func (*XtreamCodes) StreamURL

func (x *XtreamCodes) StreamURL(streamID int, wantedFormat string) (string, error)

StreamURL returns a fully formed URL to a video stream for the given streamID and wantedFormat. Refresh causes the provider to request the latest information. Configuration returns the base configuration backing the provider

Jump to

Keyboard shortcuts

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