Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-4196

camera component not stopping streams when detaching

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 8.6.0.1
    • Fix Version/s: 8.6.1
    • Component/s: Components
    • Security Level: Jimmy
    • Labels:
    • gh.sprint.customfield.default.name:
      ZK 8.6.1 S1

      Description

      Steps to Reproduce

      start a camera component (requestCamera) camera-stop.zul
      detach the component (click the 'detach' button)

      Current Result

      the camera light (indicating recording) remains activated

      Expected Result

      the camera should stop streaming when the component is detached

      Root Cause

      the individual tracks (audio/video) inside the stream object (video.srcObject) keep running and need to be stopped individually

      Workaround

      zk.afterLoad('zkmax.med', function() {
      	var xCamera = {};
      	zk.override(zkmax.med.Camera.prototype, xCamera, {
      		unbind_: function() {
      			var video = this.$n('real');
      			var stream = video.srcObject;
      			if(stream) {
      				stream.getTracks().forEach(function(track) {
      					track.stop();
      				});
      				video.srcObject = null;
      			}
      			xCamera.unbind_.apply(this, arguments);
      		}
      	});//zk.override
      });//zk.afterLoad
      

        Attachments

          Activity

            People

            Assignee:
            CharlesQiu CharlesQiu
            Reporter:
            cor3000 cor3000
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 4 hours
                4h
                Remaining:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                1h
                Logged:
                Time Spent - 3 hours Remaining Estimate - 1 hour
                3h