|
发表于 2003-12-8 14:15:08
|
显示全部楼层
原理跟mozilla的差不多,但简化了很多,大概300行代码.
过程大概是这样:
NPPluginFuncs *npp;
NPNetscapeFuncs *npn;
NPStream stream;
NP_Initialize (npn, npp);//在libflashplayer.so里
NPP_Initialize();//在libflashplayer.so里
构造一个NPWindow *类型窗口,可以参考mozilla的,比如这个变量名叫npwindow;
NPP instance;并给instance分配内存
npp->newp(.................)
npp->setwindow(instance,npwindow);
npp->newstream(instace,NULL,&stream,0,...);
npp->writeready(instance,&stream);
npp->write(instance,&stream,.........);
npp->destroystream(instance,&stream,0); |
|