aullman / opentok-whiteboard

Shared Whiteboard that works with OpenTok
MIT License
34 stars 22 forks source link

Whiteboard on mobile #19

Closed hpsrini closed 8 years ago

hpsrini commented 8 years ago

Used opentok whiteboard with the cordova plugin. Renders fine on mobile. Whatever is drawn shows up on my desktop browser. But, the mobile app does not seem to receive anything written on the desktop or on another mobile app. Its a straight-forward implementation. Any idea why?

hpsrini commented 8 years ago

Ok. Figured out the issue. The OTSession.session is not available when the signal events are bound in whiteboard. Delaying the binding helped. Was trying to watch the session variable and bind when available, but was not successful. Any other solution?

aullman commented 8 years ago

I guess you could wait to create the ot-whiteboard element until after the session is connected. Something like:

$scope.connected = false;
OTSession.init('YOUR_APIKEY', 'YOUR_SESSION_ID', 'YOUR_TOKEN', function (err) {
                if (!err) {
                    $scope.$apply(function () {
                        $scope.connected = true;
                    });
                }
            });
<ot-whiteboard ng-if="connected" width="1280" height="960"></ot-whiteboard>
hpsrini commented 8 years ago

Thanks, Adam! This helps.