Requests the creation of a new data stream produced by the plug-in and consumed by the browser.
#include <npapi.h> NPError NPN_NewStream(NPP instance, NPMIMEType type, const char* target, NPStream** stream);
The function has the following parameters:
- Pointer to current plug-in instance.
- MIME type of the stream.
- Name of the target window or frame, or one of several special target names. For values, see NPN_GetURL.
- Stream to be created by the browser.
- If successful, the function returns NPERR_NO_ERROR.
- If unsuccessful, the plug-in is not loaded and the function returns an error code. For possible values, see Error Codes.
NPN_NewStream creates a new stream of data produced by the plug-in and consumed by the browser.
The MIME parameter is the MIME type of the plug-in to create. A plug-in can create another instance of itself by specifying its own MIME type and a new target name in a call to
The stream is returned in the stream parameter. The plug-in can use this object in subsequent calls to NPN_Write to write data into the stream. When the plug-in has written all of its data into the stream, NPN_DestroyStream terminates the stream and deallocates the NPStream object.
The target parameter is the name of the target window or frame, or one of several special target names. For parameter values and information about how to use them, see NPN_GetURL. If the new stream has the target of _self, this function should return an INVALID_PARAM NP Error.