move global devDependency to normal dependency (#788)
* import window from global where we use it * fix linting issues
Showing
8 changed files
with
13 additions
and
4 deletions
... | @@ -87,7 +87,8 @@ | ... | @@ -87,7 +87,8 @@ |
87 | "aes-decrypter": "^1.0.3", | 87 | "aes-decrypter": "^1.0.3", |
88 | "video.js": "^5.10.1", | 88 | "video.js": "^5.10.1", |
89 | "videojs-contrib-media-sources": "^3.1.0", | 89 | "videojs-contrib-media-sources": "^3.1.0", |
90 | "videojs-swf": "^5.0.2" | 90 | "videojs-swf": "^5.0.2", |
91 | "global": "^4.3.0" | ||
91 | }, | 92 | }, |
92 | "devDependencies": { | 93 | "devDependencies": { |
93 | "babel": "^5.8.0", | 94 | "babel": "^5.8.0", |
... | @@ -99,7 +100,6 @@ | ... | @@ -99,7 +100,6 @@ |
99 | "cowsay": "^1.1.0", | 100 | "cowsay": "^1.1.0", |
100 | "doctoc": "^0.15.0", | 101 | "doctoc": "^0.15.0", |
101 | "glob": "^6.0.3", | 102 | "glob": "^6.0.3", |
102 | "global": "^4.3.0", | ||
103 | "jsdoc": "^3.4.0", | 103 | "jsdoc": "^3.4.0", |
104 | "karma": "^0.13.0", | 104 | "karma": "^0.13.0", |
105 | "karma-browserify": "^4.4.0", | 105 | "karma-browserify": "^4.4.0", | ... | ... |
... | @@ -9,6 +9,7 @@ import resolveUrl from './resolve-url'; | ... | @@ -9,6 +9,7 @@ import resolveUrl from './resolve-url'; |
9 | import {mergeOptions} from 'video.js'; | 9 | import {mergeOptions} from 'video.js'; |
10 | import Stream from './stream'; | 10 | import Stream from './stream'; |
11 | import m3u8 from 'm3u8-parser'; | 11 | import m3u8 from 'm3u8-parser'; |
12 | import window from 'global/window'; | ||
12 | 13 | ||
13 | /** | 14 | /** |
14 | * Returns a new array of segments that is the result of merging | 15 | * Returns a new array of segments that is the result of merging | ... | ... |
... | @@ -7,6 +7,7 @@ import videojs from 'video.js'; | ... | @@ -7,6 +7,7 @@ import videojs from 'video.js'; |
7 | import SourceUpdater from './source-updater'; | 7 | import SourceUpdater from './source-updater'; |
8 | import {Decrypter} from 'aes-decrypter'; | 8 | import {Decrypter} from 'aes-decrypter'; |
9 | import Config from './config'; | 9 | import Config from './config'; |
10 | import window from 'global/window'; | ||
10 | 11 | ||
11 | // in ms | 12 | // in ms |
12 | const CHECK_BUFFER_DELAY = 500; | 13 | const CHECK_BUFFER_DELAY = 500; | ... | ... |
... | @@ -17,6 +17,7 @@ import MasterPlaylistController from './master-playlist-controller'; | ... | @@ -17,6 +17,7 @@ import MasterPlaylistController from './master-playlist-controller'; |
17 | import Config from './config'; | 17 | import Config from './config'; |
18 | import renditionSelectionMixin from './rendition-mixin'; | 18 | import renditionSelectionMixin from './rendition-mixin'; |
19 | import GapSkipper from './gap-skipper'; | 19 | import GapSkipper from './gap-skipper'; |
20 | import window from 'global/window'; | ||
20 | 21 | ||
21 | /** | 22 | /** |
22 | * determine if an object a is differnt from | 23 | * determine if an object a is differnt from |
... | @@ -94,7 +95,7 @@ const safeGetComputedStyle = function(el, property) { | ... | @@ -94,7 +95,7 @@ const safeGetComputedStyle = function(el, property) { |
94 | return ''; | 95 | return ''; |
95 | } | 96 | } |
96 | 97 | ||
97 | result = getComputedStyle(el); | 98 | result = window.getComputedStyle(el); |
98 | if (!result) { | 99 | if (!result) { |
99 | return ''; | 100 | return ''; |
100 | } | 101 | } | ... | ... |
... | @@ -2,6 +2,7 @@ import QUnit from 'qunit'; | ... | @@ -2,6 +2,7 @@ import QUnit from 'qunit'; |
2 | import PlaylistLoader from '../src/playlist-loader'; | 2 | import PlaylistLoader from '../src/playlist-loader'; |
3 | import xhrFactory from '../src/xhr'; | 3 | import xhrFactory from '../src/xhr'; |
4 | import { useFakeEnvironment } from './test-helpers'; | 4 | import { useFakeEnvironment } from './test-helpers'; |
5 | import window from 'global/window'; | ||
5 | 6 | ||
6 | // Attempts to produce an absolute URL to a given relative path | 7 | // Attempts to produce an absolute URL to a given relative path |
7 | // based on window.location.href | 8 | // based on window.location.href | ... | ... |
... | @@ -8,6 +8,7 @@ import MediaSource from 'videojs-contrib-media-sources'; | ... | @@ -8,6 +8,7 @@ import MediaSource from 'videojs-contrib-media-sources'; |
8 | /* eslint-enable */ | 8 | /* eslint-enable */ |
9 | import testDataManifests from './test-manifests.js'; | 9 | import testDataManifests from './test-manifests.js'; |
10 | import xhrFactory from '../src/xhr'; | 10 | import xhrFactory from '../src/xhr'; |
11 | import window from 'global/window'; | ||
11 | 12 | ||
12 | // a SourceBuffer that tracks updates but otherwise is a noop | 13 | // a SourceBuffer that tracks updates but otherwise is a noop |
13 | class MockSourceBuffer extends videojs.EventTarget { | 14 | class MockSourceBuffer extends videojs.EventTarget { | ... | ... |
... | @@ -17,6 +17,7 @@ import { | ... | @@ -17,6 +17,7 @@ import { |
17 | // we need this so that it can register hls with videojs | 17 | // we need this so that it can register hls with videojs |
18 | import {HlsSourceHandler, HlsHandler, Hls} from '../src/videojs-contrib-hls'; | 18 | import {HlsSourceHandler, HlsHandler, Hls} from '../src/videojs-contrib-hls'; |
19 | import HlsAudioTrack from '../src/hls-audio-track'; | 19 | import HlsAudioTrack from '../src/hls-audio-track'; |
20 | import window from 'global/window'; | ||
20 | /* eslint-enable no-unused-vars */ | 21 | /* eslint-enable no-unused-vars */ |
21 | 22 | ||
22 | const Flash = videojs.getComponent('Flash'); | 23 | const Flash = videojs.getComponent('Flash'); |
... | @@ -117,7 +118,9 @@ QUnit.test('deprication warning is show when using player.hls', function() { | ... | @@ -117,7 +118,9 @@ QUnit.test('deprication warning is show when using player.hls', function() { |
117 | type: 'application/vnd.apple.mpegurl' | 118 | type: 'application/vnd.apple.mpegurl' |
118 | }); | 119 | }); |
119 | 120 | ||
120 | videojs.log.warn = (text) => warning = text; | 121 | videojs.log.warn = (text) => { |
122 | warning = text; | ||
123 | }; | ||
121 | let hls = this.player.hls; | 124 | let hls = this.player.hls; |
122 | 125 | ||
123 | QUnit.equal(warning, 'player.hls is deprecated. Use player.tech.hls instead.', 'warning would have been shown'); | 126 | QUnit.equal(warning, 'player.hls is deprecated. Use player.tech.hls instead.', 'warning would have been shown'); | ... | ... |
-
Please register or sign in to post a comment