Expand my Community achievements bar.

SOLVED

Custom webcam layout (and possible bugs)

Avatar

Level 3

I'm building a private video chat application.

The UI will show a big view of the received video and, beside it, a small view for the published video.

The space below the small video view will be used for several buttons and fields.

I've tried to use a Webcampublisher and a WebcamSubscriber without setting the Webcampublisher attribute in the subscriber.

When a user strats his camera the video is not shown but I still see the bar with the publisher name, pause and cancel buttons (a bug?).

Clicking on the pause or cancel buttons does nothing even when the Webcampublisher attribute is set in the WebcamSubscriber (another bug?).

Is it possible to have custom layouts where I put the published video view and recived video view in two separate independent places?

Thanks

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi Dan,

WebCamera is a pod component and contains both the Publisher and Subscriber components inside it. It contains the start/stop/pause buttons and their functionalities embedded inside it. You don't need to call any start/stop/pause API if you are using WebCamera component directly. But the drawback of using WebCamera component is you can't use customized layout. It will show all streams including yours in a grid layout.

So, for your case with the custom layout, WebCamPublisher and WebCamSubscriber should be fine.

If you are using WebcamSubscriber, the displayBar doesn't work. You need to use your Button/UIComponent to start/stop/pause. That's why pause/cancel on the bar has no effect.

For removing this bar, there is a property called displayUserBars in WebCamSubscriber which you need to set to false. The default is true.

Regarding setting webcampublisher, ideally you shouldn’t need it if you are not using your streams, but I haven't tried it. There is no harm setting it though. So, let us know if you still need to set this property to even those subscribers which doesn’t have your published stream.

Hope this helps

Thanks

Regards

Hironmay Basu

View solution in original post

3 Replies

Avatar

Former Community Member

Hi Dan,

If you are using WebcamPublisher and WebcamSubscriber for layouts, you need to use set the webcamPublisher property in WebcamSubscriber to the WebcamPublsiher instance. You can see our WebCamera example in sample apps. Although its exactly not the same, but it does similar thing.

Regarding custom layout, you can use multiple WebcamSubscribers. For your case , use one WebcamSubscriber to show your published stream by using the publisherID array to only your userID. For streams published by others, use another WebcamSubscriber that has its publisherID array set to everything except your own userID.

The WebCamera and ZoomLayout examples show variations of using multiple WebcamSubscriber. Please look into them.

Regarding blank screen, can you send me a small code where you can't see the stream even when you set the webcamPublisher property. I believe you might be doing something wrong.

Hope this helps

Thanks

Regards

Hironmay Basu

Avatar

Level 3

Hi Hironmay,

If I'm using two WebcamSubscribers, one to show my stream and another to show others,

do I need to set the webcamPublisher property in both subscribers? Intuitively I would set it only in the one that show my stream.

What functionality adds the WebCamera pod over using WebcamPublisher+WebcamSubscriber?

I'm not sure when do I need to use the pod or extend it and when the underlaying publisher/subscriber.

Bellow you can see the code I'm using.

The "pause" and "cancel"  buttons have no effect.

Is there a property that can be set to  False to remove this bar, or maybe something to change the skin?

I'm using the Flash 10 swc

<?xml version="1.0" encoding="utf-8"?>
<Application xmlns="http://www.adobe.com/2006/mxml" horizontalGap="0" xmlns:qs="qs.controls.*" horizontalAlign="left" paddingLeft="0" paddingTop="0" paddingBottom="0" paddingRight="0" layout="horizontal" backgroundColor="#ffffff"
xmlns:rtc="AfcsNameSpace" xmlns:events="com.adobe.rtc.events.*">   
    <Script>
        <![CDATA[
        ]]>
    </Script>
    <rtc:AdobeHSAuthenticator
        id="auth"
        userName="xxx@xxx.com"
        password="xxxxxx"  />
       
    <rtc:ConnectSessionContainer roomURL="https://connectnow.acrobat.com/xxx/xxxx" id="cSession" authenticator="{auth}" width="100%" height="100%">
        <VBox width="400" height="450" backgroundColor="#343434" >
            <rtc:WebcamPublisher id="webcam" height="10" />
            <rtc:WebcamSubscriber width="100%" height="400" webcamPublisher="{webcam}" />
            <HBox paddingLeft="20" horizontalGap="25">
                <Button click="{webcam.publish()}" label="Start WebCam" height="20" />
                <Button click="{webcam.stop()}" label="Stop WebCam" height="20" />
            </HBox>
        </VBox>
    </rtc:ConnectSessionContainer>
</Application>

Avatar

Correct answer by
Former Community Member

Hi Dan,

WebCamera is a pod component and contains both the Publisher and Subscriber components inside it. It contains the start/stop/pause buttons and their functionalities embedded inside it. You don't need to call any start/stop/pause API if you are using WebCamera component directly. But the drawback of using WebCamera component is you can't use customized layout. It will show all streams including yours in a grid layout.

So, for your case with the custom layout, WebCamPublisher and WebCamSubscriber should be fine.

If you are using WebcamSubscriber, the displayBar doesn't work. You need to use your Button/UIComponent to start/stop/pause. That's why pause/cancel on the bar has no effect.

For removing this bar, there is a property called displayUserBars in WebCamSubscriber which you need to set to false. The default is true.

Regarding setting webcampublisher, ideally you shouldn’t need it if you are not using your streams, but I haven't tried it. There is no harm setting it though. So, let us know if you still need to set this property to even those subscribers which doesn’t have your published stream.

Hope this helps

Thanks

Regards

Hironmay Basu

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----