Youtube.VideoSearchByIDDownloadStreamToPlayer method |
|
Remarks
Starts a download session of the requested stream, belonging to a video found through the latest search performed by the Youtube.VideoSearchByID method, and, once the download is completed, automatically loads it into the given player.
A successful call to this method allows the container application the be notified about the advancement through the CallbackForDownloaderEvents delegate which is invoked with the nEvent parameter set to one of the following values:
- the EV_DOWNLOADER_SESSION_STARTED event reports that the downloading session is started
- the EV_DOWNLOADER_SESSION_PROGRESS event informs about the download advancement expressed in percentage
- the EV_DOWNLOADER_SESSION_COMPLETED event reports that the downloading session is completed successfully
In case the connection to the remote server or the access to the remote file should fail, the CallbackForDownloaderEvents delegate is invoked with the nEvent parameter set to EV_DOWNLOADER_SESSION_FAILED.
The download can be stopped by the user through a call to the Youtube.VideoSearchByIDDownloadStop method.
For details about management of Youtube connections refer to How to enumerate and download video/audio clips from Youtube tutorial.
For further details about methods related to Youtube searches refer to the YoutubeMan class.
Syntax
[Visual Basic] Public Function VideoSearchByIDDownloadStreamToPlayer ( nPlayerIndex as Int16, nMediaType as enumMediaTypes, nType as enumYoutubeStreamType, nIndex as Int32, ByRef nDownloadUniqueId as Int32 ) as enumErrorCodes |
[C#] public enumErrorCodes VideoSearchByIDDownloadStreamToPlayer ( Int16 nPlayerIndex, enumMediaTypes nMediaType, enumYoutubeStreamType nType, int nIndex, ref Int32 nDownloadUniqueId ); |
[C++] public: enumErrorCodes VideoSearchByIDDownloadStreamToPlayer ( Int16 nPlayerIndex, enumMediaTypes nMediaType, enumYoutubeStreamType nType, int nIndex, Int32 __gc *nDownloadUniqueId ); |
Parameter |
Description |
||||||||||||
|
|
||||||||||||
nPlayerIndex |
Number representing the zero-based index of the player that will load the stream |
||||||||||||
nMediaType |
Media type. Supported values are the following:
|
||||||||||||
nType |
Type of stream. Supported values are the following:
|
||||||||||||
nIndex |
Zero-based index of the stream. The maximum number of available streams can be obtained through the Youtube.VideoSearchByIDStreamCountGet method. |
||||||||||||
nDownloadUniqueId |
Reference that, after returning from the method call, will contain the unique identifier of the download session: this identifier may be passed to the Youtube.VideoSearchByIDDownloadStop method when the download session must be stopped by the user. |
Return value
Value |
Meaning |
|
|
Negative value |
An error occurred, check the LastError property value in order to get the error code |
enumErrorCodes.ERR_NOERROR (0) |
The method call was successful |