我注意到 Spark AR 有一个实时流媒体模块有没有一种方法可以模拟或测试实时反应和评论而无需在 facebook 上直播?
我想测试以下代码是否真的有效,但我不想在我的 facebook 帐户上实时测试它并要求人们对流做出反应和评论。
const LiveStreaming = require('LiveStreaming');
const Scene = require('Scene');
const matchCounterText = Scene.root.find('text1');
const comments = LiveStreaming.comments;
const matchStrings = ['cat','dog'];
const isCaseSensitive = false;
var leadingCount = 0;
comments.startMatchCounter(matchStrings,isCaseSensitive).subscribe(
function(result) {
for (var key in result) {
if (result[key] > leadingCount) {
matchCounterText.text = key;
leadingCount = result[key];
}
}
});