How to clear camera view item?

Hello,

I am trying to clear the camera assigned to a view in the following way. But it does not clear, continues to display video from the camera.

var clearVideoPlayers= function() { 
  if (typeof(SCS) !== 'undefined') {
    alert('Clearing Video players');
    for(var ind=1; ind<=Object.keys(GLOBAL.playerDict).length;ind++){
      SCS.Views.SetCameraViewItemCamera(ind, '');
    }
  }
}

Please let me know if this is the correct usage of API.

Thanks

Giridhar

I do not think you can use an empty string to clear a camera. Maybe you can switch view instead.

Would it be possible for you to use a plug-in instead of a script? Explore the Smart Client View and Windows tool plugin sample.

Hello Bo,

Thanks for the reply. The requirement is that the View shows 4 cameras on top and a html page at the bottom. The html page has a button, on click needs to clear all 4 camera videos. I have attached the View layout.

You have mentioned about switch view, could you please elaborate on this. Is there any javascript API to achieve this? I do not know how to achieve this from a plugin side. I am quite new to the Plugin code.

Any idea or code sample would be of great help.

Thanks

Giridhar

Working with plug-ins (.net). Look at the Smart Client Dynamic View plugin sample. Look at the Smart Client View and Windows tool plugin sample.