-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Normal
-
Affects Version/s: 8.6.0.1
-
Component/s: Components
-
Security Level: Jimmy
-
ZK 8.6.1 S1
-
None
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