Class: Chromecast

Chromecast


new Chromecast( [options] [, ready])

Create a Chromecast tech object

Parameters:
Name Type Argument Description
options Array.<Object> <optional>

Object of option names and values

ready function <optional>

Ready callback function

Members


namespace

Get CC namespace

Methods


<static> isSupported()

Is supported

Returns:

is CC Supported

Type
boolean

autoplay()

autoplay

Returns:

autoplay

Type
boolean

baseCurrentTime()

video elm CurrentTime

Returns:

CurrentTime

Type
number

bitrate()

bitrate


bitrates()

bitrates

Returns:

bitrates

Type
Array

buffered()

Get buffered time range

No support by cast tech.

Returns:
  • Type
    TimeRangeObject
  • buffer TimeRange

    Type
    *

canRestart()

canRestart

Returns:

canRestart

Type
boolean

castError(error)

Set or Get castError

Parameters:
Name Type Description
error Object

controls()

Has controls

Returns:

has controls

Type
boolean

createEl()

Create the Components DOM element.

Returns:

The element that was created.

Type
Element

currentSource()

currentSource

Returns:

currentSource

Type
Object

currentSrc()

currentSrc

Returns:

currentSrc

Type
string

currentTime()

currentTime

Returns:

currentTime

Type
boolean

disableTimeShift(disable)

Disables timeshifting

Parameters:
Name Type Description
disable boolean

disconnectChromecast()

disconnectChromecast


dispose()

dispose the tech


dropMediaSession()

dropMediaSession


duration()

Get the current duration for the Cast tech.

Returns:

The duration of the media or 0 if there is no duration.

Type
number

ended()

Returns true if the video has ended
We check for 'idle' which means there is no active playback.

Returns:

has ended

Type
boolean

getAbsoluteTime(nowDate)

getAbsoluteTime

Parameters:
Name Type Description
nowDate Date
Returns:

AbsoluteTime

Type
number

getBitrate()

getBitrate


gotoLive()

gotoLive


lineupSource(source)

Add source to playlist

Parameters:
Name Type Description
source Object

live()

Is current playback live or not?

Returns:

whether or not current playback is live

Type
boolean

liveDelay()

liveDelay

Returns:

liveDelay

Type
number

loadNextSource()

loadNextSource


muted()

is muted

Returns:

is muted

Type
boolean

onEnded()

onEnded


onMediaStatusUpdate()

onMediaStatusUpdate


onMessage(namespace, json)

onMessage

Parameters:
Name Type Description
namespace string
json Object

onSeekDone()

onSeekDone


onSessionUpdate(isAlive)

onSessionUpdate

Parameters:
Name Type Description
isAlive boolean

pause()

pause

Returns:

is paused

Type
boolean

paused()

paused

Returns:

is paused

Type
boolean

play()

Start Play

Returns:

is Playing

Type
boolean

playbackRate()

Gets or sets the current playback rate.

Returns:

The current playback rate when getting or 1.0

Type
number

playNextProgram()

playNextProgram


playPreviousProgram(end)

playPreviousProgram

Parameters:
Name Type Description
end boolean

Start from end


poster()

Get poster

Returns:

poster url

Type
string

pullUpdateFromCC()

pullUpdateFromCC


reset()

reset


seekable()

Determine if we can seek in media

Returns:

seek Range

Type
TimeRangeObject

seeking()

seeking

Returns:

seeking

Type
boolean

sendAudioLanguage(languageCode, kind)

sendAudioLanguage

Parameters:
Name Type Description
languageCode string
kind string

sendHideTextTrack()

sendHideTextTrack


sendMessage(message)

sendMessage

Parameters:
Name Type Description
message string

sendShowTextTrack(textTrack)

sendShowTextTrack

Parameters:
Name Type Description
textTrack Object

sendTextTrackStyle(texttrackstyle)

sendTextTrackStyle

Parameters:
Name Type Description
texttrackstyle Object

setAbsoluteTime(value)

setAbsoluteTime

Parameters:
Name Type Description
value Date

setAutoplay()

setAutoplay


setCurrentTime(position)

Set current time for the Cast tech.

Parameters:
Name Type Description
position number

Set the current time of the media to this.


setMuted(muted)

Set is muted

Parameters:
Name Type Description
muted boolean

setPlaybackRate( [rate])

Sets the current playback rate.

Parameters:
Name Type Argument Description
rate number <optional>

New playback rate to set.


setPoster(val)

Set poster

Parameters:
Name Type Description
val string

URL to poster image


setVolume(level, mute)

Set the Volume

Parameters:
Name Type Default Description
level number
mute boolean false

is muted


startTimeLive()

startTimeLive

Returns:

startTimeLive

Type
number

stop( [afterStopCallback])

stop casting

Parameters:
Name Type Argument Description
afterStopCallback function <optional>

supportsFullScreen()

Tech supports FullScreen

Returns:

supportsFullScreen

Type
boolean

techVersion()

Version of the Tech

Returns:

Version

Type
string

timeBehindLive(nowDate)

timeBehindLive

Parameters:
Name Type Description
nowDate Date
Returns:

timeBehindLive

Type
number

timeShiftEnabled()

Get timeShiftEnabled

Returns:

if timeShift is enabled

Type
boolean

update()

update DOM


updateMediaSession(mediaSession)

updateMediaSession

Parameters:
Name Type Description
mediaSession Object

mediaSession


updateTracks(data)

Update tracks from Receive

Parameters:
Name Type Description
data Object

volume()

Get volume

Returns:

volume

Type
Object