AWS Chime-将视频分配给图块无法正常工作 [英] AWS Chime - assigning videos to tiles does not work as expected

查看:95
本文介绍了AWS Chime-将视频分配给图块无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我以这种方式设置了一个AWS Chime会议,其中包含5个视频图块(video-tile-0到video-tile-4):


I have an AWS Chime meeting setup in this fashion with 5 video tiles (video-tile-0 through video-tile-4):

会议建立后,观察者回调 audioVideoDidStart 开始,此时我绑定了#local-video-tile

When the meeting is established, the observer callback audioVideoDidStart gets kicked off, at which point I bind my #local-video-tile

var localTileId = meetingSession.audioVideo.startLocalVideoTile();
meetingSession.audioVideo.bindVideoElement(localTileId, videoElement);
$(videoElement).show();

接下来,用户单击开始共享以激活 meetingSession.audioVideo.startContentShareFromScreenCapture();
共享开始后,将调用观察者回调 videoTileDidUpdate .

这就是我的问题.我有2个视频图块应被占用.

然后 videoTileDidUpdate = tile => 循环遍历tileId为1且tileId为2的tile.
但是每个tileId都会循环4次.每次,即使每个图块具有相同的tileId,其设置也不同.

Next the user clicks Start Share to active the meetingSession.audioVideo.startContentShareFromScreenCapture();
After the share begins, the observer callback videoTileDidUpdate gets called.

And herein lies my problem. I have 2 video tiles that should be occupied.

The videoTileDidUpdate = tile => then loops through the tiles with tileId of 1 and tileId of 2.
But each tileId is looped through 4 times. And each time, each tile has different settings even though it has the same tileId.

tileId: 1,
active: false,
isContent: false,
isLocal: true,
boundAttendeeId: null

tileId: 1,
active: true,
isContent: false,
isLocal: true,
boundAttendeeId: <guid>

tileId: 1,
active: true,
isContent: false,
isLocal: true:
boundAttendeeId: null

tileId: 1,
active: false,
isContent: false,
isLocal: true:
boundAttendeeId: null

tileId: 2,
active: false,
isContent: false,
isLocal: false,
boundAttendeeId: null

tileId: 2,
active: false,
isContent: true,
isLocal: false,
boundAttendeeId: <guid>#content

tileId: 2,
active: true,
isConent: true,
isLocal: false,
boundAttendeeId: <guid>

tileId: 2,
active: false,
isContent: false,
isLocal: false,
boundAttendeeId: null



通过使用tile对象中提供的标志,我消除了循环中的许多内容.



I have eliminated many in the loop by using the flags provided in the tile object.

videoTileDidUpdate: tile => {
    if (tile.active || tile.localTile) return;

    if (tile.isContent && tile.boundAttendeeId) {
        var contentVideoEl = document.getElementById("screen-share-tile");
        meetingSession.audioVideo.bindVideoElement(tile.tileId, contentVideoEl);
    } else if (tile.boundAttendeeId || tile.isContent || tile.localTile) {
        return;
    } 
    else
    {
        var videoElement = attendeeVideoElements[tile.tileId - 1];
        meetingSession.audioVideo.bindVideoElement(tile.tileId, videoElement);
    }
}


//Which now outputs:
tileId: 2,
active: false,
isContent: false,
isLocal: false,
boundAttendeeId: null

tileId: 2,
active: false,
isContent: true,
isLocal: false,
boundAttendeeId: <guid>#content



如您所知,这会将我的screenShare绑定到#screen-share-tile video-tile-2

我该如何预防呢?
我还缺少另一个布尔值吗?

现在,它在文档中说, isContent 将代表屏幕共享或用户共享的内容(如视频),那么tileId 2如何具有所有这些不同的设置?是否正确标记了tileId?

我尝试了if块的许多不同变体,并在 startContentShareFromScreenCapture(< state>)中设置状态无效.
AWS提供的资源是摘要,关于其中任何内容的工作原理的描述确实很少. https://aws.github.io/amazon-chime-sdk-js/index.html

任何帮助是极大的赞赏!我已经为此苦苦挣扎了两个星期.



As you can tell, this will bind my screenShare to both the #screen-share-tile and the video-tile-2

How can I prevent this?
Is there another boolean value I'm missing?

Now it says in the docs that the isContent will represent a screen share or user's shared content (like a video), so how is it that tileId 2 can have all of these different settings? Is it labelling the tileId correctly?

I have tried many different variations of the if blocks and setting a state in the startContentShareFromScreenCapture(<state>) to no avail.
The resources provided by AWS are snippets and there's really not much for descriptions on how any of it is supposed to work. https://aws.github.io/amazon-chime-sdk-js/index.html

Any help is greatly appreciated! I've been struggling through this for two weeks now.

推荐答案

我会很快回答自己的问题,因为我知道越来越多的人正在寻找答案.

I'll answer my own question real quick because I know more and more people have been looking at this for answers.

是,要:我还缺少另一个布尔值吗?"那是我的问题的答案,但我想我会尽力像我一样帮助任何在JS SDK上苦苦挣扎的人.

YES to: "Is there another boolean value I'm missing?" that was the anwer to my question, but I thought I'd try to help anyone struggling with the JS SDK like I did.

我最好的建议是检出文档....但是

要了解任何文档,您必须了解观察者.这是了解他们的系统如何工作的关键.audioVideoObeserver到底能做什么...?

The best recommendation I have is to check out the docs....BUT

To understand any of the docs you have to understand the observers. That is the key to understanding how their system works. The audioVideoObeserver does exactly what...?

然后注意,还有其他观察者.这些观察者对...有什么看法?

Then notice that there are other Observers. And these observers to what...?

诚然,有些观察似乎重叠,可能会引起混淆,但是请仔细查看示例,并注意其使用的观察者具有什么功能.

Admittedly, there are some observes seem to overlap which can get confusing, but look at the examples and pay attention to what observer they are using for what functionality.

然后理解那些观察者是循环运行的.您需要弄清的最后一件事是在每个循环中检查哪些值.请注意,模式是相同的.

Then understand that those observers run in a loop. The last thing you have to figure out is what values to check for inside each loop. Notice that the pattern is the same.

希望对某人有帮助.

这篇关于AWS Chime-将视频分配给图块无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆