N
O
D
E
M
E
D
I
A
Thinking
首页
产品
文档
博客
订单
文档
播放API
2026年 5月 20日 下午3:55
## NodePlayer NodePlayer是用于直播播放的低延迟播放器 ### NodePlayer *NodePlayer_new(const char *license) 创建播放器对象, 返回对象指针 ### void NodePlayer_free(NodePlayer *ctx) 释放播放对象, 传入指针 ### void NodePlayer_setEventCallback(NodePlayer *ctx, onEventCallback cb, void *userdata) 设置事件回调函数 ### void NodePlayer_setLogLevel(NodePlayer *ctx, int logLevel) 设置日志等级 ### void NodePlayer_setAudioEnable(NodePlayer *ctx, bool enable) 设置音频是否开启 ### void NodePlayer_setVideoEnable(NodePlayer *ctx, bool enable) 设置视频是否开启 ### void NodePlayer_setHwaccelEnable(NodePlayer *ctx, bool enable) 设置硬件加速是否开启 ### void NodePlayer_setBufferTime(NodePlayer *ctx, int bufferTime) 设置缓冲时长,单位毫秒 ### void NodePlayer_setScaleMode(NodePlayer *ctx, int scaleMode) 设置画面缩放模式 ### void NodePlayer_setCryptoKey(NodePlayer *ctx, const char *cryptoKey) 设置音视频内容解密密码,长度固定16个字节 ### void NodePlayer_setVolume(NodePlayer *ctx, float volume) 设置播放音量,0.0 -- 1.0 ### int NodePlayer_attachView(NodePlayer *ctx, void *hwnd) 附加到hwnd做视频视图 ### int NodePlayer_attachViewEx(NodePlayer *ctx, void *hwnd, int x, int y, int w, int h) 附加到hwnd做视频视图, 并调整位置和大小 ### int NodePlayer_detachView(NodePlayer *ctx) 从视图中脱离 ### int NodePlayer_onResize(NodePlayer *ctx) 当布局改变后,通知播放器调整比例 ### int NodePlayer_onResizeEx(NodePlayer *ctx, int x, int y, int w, int h) 当布局改变后,通知播放器调整比例,位置,大小 ### int NodePlayer_start(NodePlayer *ctx, const char *url) 开始播放 ### int NodePlayer_stop(NodePlayer *ctx) 停止播放 ## 播放事件 ### 1000 准备播放 ### 1001 播放成功 ### 1002 播放失败 ### 1003 播放重连 ### 1004 播放结束 ### 1005 播放中网络异常 ### 1006 播放超时 ### 1100 数据缓冲区为空 ### 1101 数据缓冲中 ### 1102 数据缓冲满,开始渲染 ### 1103 数据统计,每秒一次
嘿,我是小R,需要帮助随时找我哦
QQ客服:281269007
邮件支持
扫码加微信
回到顶部