Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.
SOLVED

WebcamPublisher/onNetStatus() line 1400 TypeError: Error #1009: Cannot access a property or method

Avatar

Level 3

Hello,

I am using the webCamera pod.

This error occurs after the following happens:

A user calls

     webCamPub.startWebcam();

After a while I stop this publisher with this

     webCamPub.publisher.stop(null);

and with another user I call again

     webCamPub.startWebcam();

At this point I get this error ( right after netstream connect success):

11:20:44 GMT+0200    mainNetStatusHandler: NetStream.Connect.Success

TypeError: Error #1009: Cannot access a property or method of a null object reference.
    at com.adobe.rtc.collaboration::WebcamPublisher/onNetStatus()[E:\flashfarm\branches\connect\1108\SDKApp\payload\libs\player10.3\src\com\adobe\rtc\collaboration\WebcamPublisher.as:1400]

The WebcamPublisher function in question (with bolded error line )

        protected function onNetStatus(p_evt:NetStatusEvent):void
        {
            if (p_evt.info.code=="NetStream.Connect.Success") {
                setTimeout(sendSnapShotPermission, 500);
                _stream.send("|RtmpSampleAccess", true, true);
            }
        }

If I didmiss the error message, the app continues just fine with the expected behavior.

I did try calling webCamPub.close() after stopping the publisher and the error does not happen but afterwards this same user does not subscribe (with WebCamera pod)...

Any tips apart from implementing my own webcampublisher and webcamsubscriber solution?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

Hi there,

Hmmm, this seems to be a weird race condition - do you see it every time,

regardless of timing? We'll get it fixed for the next release (in weeks, not

months).

In the meantime, a trivial fix would be to subclass WebCamPublisher like

so :

        override protected function onNetStatus(p_evt:NetStatusEvent):void

        {

            if (p_evt.info.code=="NetStream.Connect.Success" && _stream) {

                setTimeout(sendSnapShotPermission, 500);

                _stream.send("|RtmpSampleAccess", true, true);*

            }

        }

nigel

View solution in original post

2 Replies

Avatar

Correct answer by
Former Community Member

Hi there,

Hmmm, this seems to be a weird race condition - do you see it every time,

regardless of timing? We'll get it fixed for the next release (in weeks, not

months).

In the meantime, a trivial fix would be to subclass WebCamPublisher like

so :

        override protected function onNetStatus(p_evt:NetStatusEvent):void

        {

            if (p_evt.info.code=="NetStream.Connect.Success" && _stream) {

                setTimeout(sendSnapShotPermission, 500);

                _stream.send("|RtmpSampleAccess", true, true);*

            }

        }

nigel

Avatar

Level 3

Yep, that did it, appreciated Nigel.

The error was quite consistent although I managed to catch a few occasions when it did not occur. Maybe some kind of synching issue with _stream...

Anyway, the stuff works now which will do it for me.

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] ----