Remove console.logs
Use videojs.log instead of console.log but in general prefer quieter operation.
Showing
6 changed files
with
11 additions
and
33 deletions
... | @@ -25,10 +25,6 @@ window.videojs.hls.ExpGolomb = function(workingData) { | ... | @@ -25,10 +25,6 @@ window.videojs.hls.ExpGolomb = function(workingData) { |
25 | return (8 * workingBytesAvailable) + workingBitsAvailable; | 25 | return (8 * workingBytesAvailable) + workingBitsAvailable; |
26 | }; | 26 | }; |
27 | 27 | ||
28 | this.logStuff = function() { | ||
29 | console.log('bits', workingBitsAvailable, 'word', (workingWord >>> 0)); | ||
30 | }; | ||
31 | |||
32 | // ():void | 28 | // ():void |
33 | this.loadWord = function() { | 29 | this.loadWord = function() { |
34 | var | 30 | var | ... | ... |
... | @@ -47,7 +47,6 @@ hls.FlvTag = function(type, extraData) { | ... | @@ -47,7 +47,6 @@ hls.FlvTag = function(type, extraData) { |
47 | try { | 47 | try { |
48 | this.bytes.set(bytes.subarray(offset, offset + length), this.position); | 48 | this.bytes.set(bytes.subarray(offset, offset + length), this.position); |
49 | } catch(e) { | 49 | } catch(e) { |
50 | console.log(e); | ||
51 | throw e; | 50 | throw e; |
52 | } | 51 | } |
53 | this.position += length; | 52 | this.position += length; | ... | ... |
... | @@ -90,8 +90,6 @@ | ... | @@ -90,8 +90,6 @@ |
90 | } else if (0 !== sps0[offset + 0]) { | 90 | } else if (0 !== sps0[offset + 0]) { |
91 | offset += 1; | 91 | offset += 1; |
92 | } else { | 92 | } else { |
93 | console.log('found emulation bytes'); | ||
94 | |||
95 | rbsp.set([0x00, 0x00], rbspCount); | 93 | rbsp.set([0x00, 0x00], rbspCount); |
96 | spsCount += 2; | 94 | spsCount += 2; |
97 | rbspCount += 2; | 95 | rbspCount += 2; |
... | @@ -311,7 +309,6 @@ | ... | @@ -311,7 +309,6 @@ |
311 | }; | 309 | }; |
312 | 310 | ||
313 | this.finishFrame = function() { | 311 | this.finishFrame = function() { |
314 | console.log('finish frame'); | ||
315 | if (h264Frame) { | 312 | if (h264Frame) { |
316 | // Push SPS before EVERY IDR frame fo seeking | 313 | // Push SPS before EVERY IDR frame fo seeking |
317 | if (newExtraData.extraDataExists()) { | 314 | if (newExtraData.extraDataExists()) { | ... | ... |
... | @@ -65,18 +65,8 @@ | ... | @@ -65,18 +65,8 @@ |
65 | } | 65 | } |
66 | }; | 66 | }; |
67 | 67 | ||
68 | self.onM3U8LoadError = function(error) { | 68 | self.onM3U8LoadError = function() {}; |
69 | if(error) | 69 | self.onM3U8Update = function() {}; |
70 | { | ||
71 | console.log(error); | ||
72 | } | ||
73 | }; | ||
74 | self.onM3U8Update = function(m3u8) { | ||
75 | if(m3u8) | ||
76 | { | ||
77 | console.log(m3u8); | ||
78 | } | ||
79 | }; | ||
80 | 70 | ||
81 | self.loadSegment = function(segment) { | 71 | self.loadSegment = function(segment) { |
82 | self.segmentController = new SegmentController(); | 72 | self.segmentController = new SegmentController(); |
... | @@ -100,12 +90,7 @@ | ... | @@ -100,12 +90,7 @@ |
100 | self.loadSegment(self.currentManifest.mediaItems[self.currentSegment]); | 90 | self.loadSegment(self.currentManifest.mediaItems[self.currentSegment]); |
101 | }; | 91 | }; |
102 | 92 | ||
103 | self.onSegmentLoadError = function(error) { | 93 | self.onSegmentLoadError = function() {}; |
104 | if(error) | ||
105 | { | ||
106 | console.log(error); | ||
107 | } | ||
108 | }; | ||
109 | 94 | ||
110 | }; | 95 | }; |
111 | })(this); | 96 | })(this); | ... | ... |
... | @@ -53,7 +53,7 @@ | ... | @@ -53,7 +53,7 @@ |
53 | 53 | ||
54 | self.onSegmentLoadError = function(error) { | 54 | self.onSegmentLoadError = function(error) { |
55 | if (error) { | 55 | if (error) { |
56 | console.log(error.message); | 56 | throw error; |
57 | } | 57 | } |
58 | 58 | ||
59 | if (self.onErrorCallback !== undefined) { | 59 | if (self.onErrorCallback !== undefined) { | ... | ... |
1 | (function(window) { | 1 | (function(window) { |
2 | var | 2 | var |
3 | FlvTag = window.videojs.hls.FlvTag, | 3 | videojs = window.videojs, |
4 | H264Stream = window.videojs.hls.H264Stream, | 4 | FlvTag = videojs.hls.FlvTag, |
5 | AacStream = window.videojs.hls.AacStream, | 5 | H264Stream = videojs.hls.H264Stream, |
6 | AacStream = videojs.hls.AacStream, | ||
6 | m2tsPacketSize = 188; | 7 | m2tsPacketSize = 188; |
7 | 8 | ||
8 | console.assert(H264Stream); | 9 | console.assert(H264Stream); |
... | @@ -150,7 +151,7 @@ | ... | @@ -150,7 +151,7 @@ |
150 | // until we receive more | 151 | // until we receive more |
151 | 152 | ||
152 | // ?? this seems to append streamBuffer onto data and then just give up. I'm not sure why that would be interesting. | 153 | // ?? this seems to append streamBuffer onto data and then just give up. I'm not sure why that would be interesting. |
153 | console.log('data.length + streamBuffer.length < m2tsPacketSize ??'); | 154 | videojs.log('data.length + streamBuffer.length < m2tsPacketSize ??'); |
154 | streamBuffer.readBytes(data, data.length, streamBuffer.length); | 155 | streamBuffer.readBytes(data, data.length, streamBuffer.length); |
155 | return; | 156 | return; |
156 | } else { | 157 | } else { |
... | @@ -194,7 +195,7 @@ | ... | @@ -194,7 +195,7 @@ |
194 | // If there was an error parsing a TS packet. it could be | 195 | // If there was an error parsing a TS packet. it could be |
195 | // because we are not TS packet aligned. Step one forward by | 196 | // because we are not TS packet aligned. Step one forward by |
196 | // one byte and allow the code above to find the next | 197 | // one byte and allow the code above to find the next |
197 | console.log('error parsing m2ts packet, attempting to re-align'); | 198 | videojs.log('error parsing m2ts packet, attempting to re-align'); |
198 | dataPosition++; | 199 | dataPosition++; |
199 | } | 200 | } |
200 | } | 201 | } |
... | @@ -382,7 +383,7 @@ | ... | @@ -382,7 +383,7 @@ |
382 | } else if (0x1FFF === pid) { | 383 | } else if (0x1FFF === pid) { |
383 | // NULL packet | 384 | // NULL packet |
384 | } else { | 385 | } else { |
385 | console.log("Unknown PID " + pid); | 386 | videojs.log("Unknown PID parsing TS packet: " + pid); |
386 | } | 387 | } |
387 | 388 | ||
388 | return true; | 389 | return true; | ... | ... |
-
Please register or sign in to post a comment