(function (context, $) {

  "use strict";

  context.JK = context.JK || {};
  context.JK.AccountVideoProfile = function (app) {
    var webcamViewerReact = null;
    function initialize() {
      var screenBindings = {
        'beforeShow': beforeShow,
        'beforeHide':beforeHide
      };
      app.bindScreen('account/video', screenBindings);

      var reactElement = React.createElement(window.WebcamViewer, {isVisible: false, show_header: true, show_disable: true});
      var reactDomNode = $("#account-video-profile .webcam-container").get(0)
      webcamViewerReact = React.render(reactElement, reactDomNode)
    }


    function beforeShow() {
      webcamViewerReact.beforeShow()
    }

    function beforeHide() {
      webcamViewerReact.beforeHide()
    }

    this.beforeShow = beforeShow
    this.beforeHide = beforeHide
    this.initialize = initialize
    return this;
  };

})(window, jQuery);