C# Class Business.DownloadBusiness

Afficher le fichier Open project: mysteryx93/NaturalGroundingPlayer Class Usage Examples

Méthodes publiques

Свойство Type Description
DownloadedExtensions string[]

Méthodes publiques

Méthode Description
DownloadVideoAsync ( Media video, int queuePos, EventHandler callback ) : Task

Downloads specified video from YouTube.

DownloadVideoAsync ( Media video, int queuePos, bool upgradeAudio, EventHandler callback ) : Task

Downloads specified video from YouTube.

GetAudioExtension ( AudioType audio ) : string

Returns the file extension for specified audio type.

GetCodecExtension ( VideoType video ) : string

Returns the file extension for specified video codec type. To avoid conflicting file names, the codec extension must be different than the final extension.

GetDownloadUrlsAsync ( string url ) : Task>

Returns the list of download URLs from YouTube.

GetFinalExtension ( VideoType video, AudioType audio ) : string

Returns the file extension for specified video type. To avoid conflicting file names, the codec extension must be different than the final extension.

GetFinalExtension ( string video, string audio ) : string

Returns the file extension for specified video type. To avoid conflicting file names, the codec extension must be different than the final extension.

IsDownloadDuplicate ( Media request ) : bool
SelectBestAudio ( IEnumerable list ) : VideoInfo

Selects OGG (Vorbis) audio if available, otherwise AAC.

SelectBestFormat ( IEnumerable list ) : BestFormatInfo

Returns the best format from the list in this order of availability: WebM, Mp4 or Flash. Mp4 will be chosen if WebM is over 35% smaller.

Private Methods

Méthode Description
DownloadCanceled ( Business.DownloadItem downloadInfo ) : void
DownloadCompletedAsync ( Business.DownloadItem downloadInfo ) : Task
DownloadFilesAsync ( Business.DownloadItem downloadInfo, EventHandler callback ) : Task

Downloads the specified list of files.

DownloadVideoAsync ( Business.DownloadItem downloadInfo, Business.DownloadItem fileInfo, EventHandler callback ) : Task
FileHasContent ( string fileName ) : bool

Returns whether specified file exists and contains data (at least 500KB).

RaiseCallback ( Business.DownloadItem downloadInfo ) : void
StartDownloadAsync ( Business.DownloadItem downloadInfo ) : Task
StartNextDownloadAsync ( ) : Task

Method Details

DownloadVideoAsync() public méthode

Downloads specified video from YouTube.
public DownloadVideoAsync ( Media video, int queuePos, EventHandler callback ) : Task
video DataAccess.Media The video to download.
queuePos int The position in the queue to auto-play, or -1.
callback EventHandler The method to call once download is completed.
Résultat Task

DownloadVideoAsync() public méthode

Downloads specified video from YouTube.
public DownloadVideoAsync ( Media video, int queuePos, bool upgradeAudio, EventHandler callback ) : Task
video DataAccess.Media The video to download.
queuePos int The position in the queue to auto-play, or -1.
upgradeAudio bool If true, only the audio will be downloaded and it will be merged with the local video file.
callback EventHandler The method to call once download is completed.
Résultat Task

GetAudioExtension() public méthode

Returns the file extension for specified audio type.
public GetAudioExtension ( AudioType audio ) : string
audio AudioType The audio type to get file extension for.
Résultat string

GetCodecExtension() public méthode

Returns the file extension for specified video codec type. To avoid conflicting file names, the codec extension must be different than the final extension.
public GetCodecExtension ( VideoType video ) : string
video VideoType The video type to get file extension for.
Résultat string

GetDownloadUrlsAsync() public static méthode

Returns the list of download URLs from YouTube.
public static GetDownloadUrlsAsync ( string url ) : Task>
url string The YouTube video URL to query.
Résultat Task>

GetFinalExtension() public méthode

Returns the file extension for specified video type. To avoid conflicting file names, the codec extension must be different than the final extension.
public GetFinalExtension ( VideoType video, AudioType audio ) : string
video VideoType The video type to get file extension for.
audio AudioType
Résultat string

GetFinalExtension() public méthode

Returns the file extension for specified video type. To avoid conflicting file names, the codec extension must be different than the final extension.
public GetFinalExtension ( string video, string audio ) : string
video string The video type to get file extension for.
audio string
Résultat string

IsDownloadDuplicate() public méthode

public IsDownloadDuplicate ( Media request ) : bool
request DataAccess.Media
Résultat bool

SelectBestAudio() public static méthode

Selects OGG (Vorbis) audio if available, otherwise AAC.
public static SelectBestAudio ( IEnumerable list ) : VideoInfo
list IEnumerable The list of available audios.
Résultat VideoInfo

SelectBestFormat() public static méthode

Returns the best format from the list in this order of availability: WebM, Mp4 or Flash. Mp4 will be chosen if WebM is over 35% smaller.
public static SelectBestFormat ( IEnumerable list ) : BestFormatInfo
list IEnumerable The list of videos to chose from.
Résultat BestFormatInfo

Property Details

DownloadedExtensions public_oe static_oe property

public static string[] DownloadedExtensions
Résultat string[]