if(!v.stream.playing) { perms.doRequest(); this.setAttribute('frame', 2); } else { v.stream._nc.close(); v.stream.stop(); v.stream.close(); this.setAttribute('frame', 1); } if(!v.stream.playing) { perms.doRequest(); this.setAttribute('frame', 2); } else { this.setAttribute('frame', 1); }