Use the `||` operator to default videojs namespace
Instead of using a conditional, use logical or when determining if videojs.hls should be stubbed out or not.
Showing
1 changed file
with
2 additions
and
6 deletions
1 | (function(window) { | 1 | (function(window) { |
2 | 2 | ||
3 | if (!window.videojs) { | 3 | window.videojs = window.videojs || {}; |
4 | window.videojs = {}; | 4 | window.videojs.hls = window.videojs.hls || {}; |
5 | } | ||
6 | if (!window.videojs.hls) { | ||
7 | window.videojs.hls = {}; | ||
8 | } | ||
9 | 5 | ||
10 | var | 6 | var |
11 | hls = window.videojs.hls, | 7 | hls = window.videojs.hls, | ... | ... |
-
Please register or sign in to post a comment