new DownloadEpisode( episode, videoPlayerId )

Description

A class used to handle the events of VideoPlayer.download.
Ensure that there's only one download max by episode

Parameters
Name Type Description
episode Episode
videoPlayerId number
Details

Videoplayer#id

Members


<static, readonly> list :Array.<DownloadEpisode>

Details

<static> toDownload :Array.<ToDownloadItem>

Details
Array.<ToDownloadItem>

<protected, static> currentDownload :DownloadEpisode


<readonly> episode :Episode

Description

The episode we want to download

Details
Episode

<readonly> id :number

Description

The unique id of the DownloadEpisode instance

Details
number

<private, readonly> player :VideoPlayer

Description

The player used to download the video (epsode)

Details
VideoPlayer

<private, readonly> isReady :boolean

Description

If the download is done and the json saved

Details
boolean

DownloadEpisode#download, DownloadEpisode#_setLocalPath


<readonly> isPending :boolean

Description

If the download is pending

Details
boolean

<readonly> isDownloading :boolean

Description

If the download is ongoing

Details
boolean

<readonly> isError :boolean

Description

If there is an error

Details
boolean

<readonly> error :string

Description

The error

Details
string

<readonly> progress :number

Description

The progress of the download

Details
number

Methods


<private> _setLocalPath( pathToFile )

Description

Call Episode#setLocalPath and set itself ready when it's done

Parameters
Name Type Description
pathToFile string
Details

Episode#setLocalPath


download( url, format )

Description

Launch the download

Parameters
Name Type Description
url string
format object
Details

DownloadEpisode#_setEvents


<private> _setEvents( emitter )

Description

Set the events of the emitter

Parameters
Name Type Description
emitter event.EventEmitter
Details

DownloadEpisode#download


destroy()

Description

Destroy the instance (Removes it from DownloadEpisode.list.)

Details

<static> getFromEpisode( episode )

Parameters
Name Type Description
episode Episode
Details