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 will fire the following sequence of events:
- the DownloaderSessionStarted event
- a sequence of DownloaderSessionProgress events informing about the download advancement in percentage
- the DownloaderSessionCompleted event
In case the connection to the remote server or the access to the remote file should fail, the DownloaderSessionFailed would be invoked.
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 |