0

I try to use a javascript library from milestone in my Angular app. I am trying to adapt from the javascript sample, see the application.js on https://github.com/milestonesys/mipsdkmobile-web

First i connect to the server:

XPMobileSDK.Connect(params, this.successConnectCallback.bind(this), this.failedConnectCallback.bind(this));

Then i make the login:

XPMobileSDK.Login(params, this.successLoginCallback.bind(this), this.failedLoginCallback.bind(this));

Then i load all Cameras:

XPMobileSDK.getAllViews(this.successLoadAllViewsCallback.bind(this), this.errorLoadAllViewsCallback.bind(this));

All this seems to work correctly. I have to use the .bind(this) in the callbacks so that the context does not break and the callback methods are also executed.

Now I have a problem when I want to start a video stream.

I call the requestStream and that returns me a connection object:

XPMobileSDK.library.Connection.RequestStream(params, this.requestStreamCallback.bind(this), this.requestStreamErrorCallback.bind(this));

As in the sample, i add an observer to it and open the connection:

requestStreamCallback(videoConnection): void {
  this.videoConnection = videoConnection;
  const videoConnectionObserver = {
    videoConnectionReceivedFrame: (frame) => this.videoConnectionReceivedFrame(frame)
  };
  videoConnection.addObserver(videoConnectionObserver);
  videoConnection.open();
}

but the videoConnectionReceivedFrame(frame) method is never called. The question is, what's going wrong? Is the method not called because the context is broken? The javascriptsample runs without problems.

In javascript as well as in the angularapp I don't get any error messages in the console, only as normal the message: Server has prepared video ID xyz

Does anyone have an idea how I can best find out what the problem is?

andreas
  • 93
  • 10

1 Answers1

0

I've got the same issue recently. Well You definitely missed to include these two modules to web page that extend html tags.

  • VideoConnection
  • VideoStream

Missed modules