提交 b59119e7 authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo

Add consumer.requestKeyFrame() method.

上级 dccc4eb1
...@@ -598,6 +598,30 @@ class Consumer extends EnhancedEventEmitter ...@@ -598,6 +598,30 @@ class Consumer extends EnhancedEventEmitter
}); });
} }
/**
* Request a key frame to the source.
*/
requestKeyFrame()
{
logger.debug('requestKeyFrame()');
if (this._closed || !this.enabled || this.paused)
return;
if (this.kind !== 'video')
return;
this._channel.request('consumer.requestKeyFrame', this._internal)
.then(() =>
{
logger.debug('"consumer.requestKeyFrame" request succeeded');
})
.catch((error) =>
{
logger.error('"consumer.requestKeyFrame" request failed: %s', String(error));
});
}
_handleWorkerNotifications() _handleWorkerNotifications()
{ {
// Subscribe to notifications. // Subscribe to notifications.
......
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论