Make plugin init a no-op if an URL is not provided
Ideally, the HLS plugin would be able to seamlessly participate in source selection but that isn't implemented yet. Until then, require an explicit manifest URL in the init options and do nothing if it's missing.
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -31,8 +31,11 @@ var | ... | @@ -31,8 +31,11 @@ var |
31 | 31 | ||
32 | if (typeof options === 'string') { | 32 | if (typeof options === 'string') { |
33 | url = options; | 33 | url = options; |
34 | } else { | 34 | } else if (options) { |
35 | url = options.url; | 35 | url = options.url; |
36 | } else { | ||
37 | // do nothing until the plugin is initialized with a valid URL | ||
38 | return; | ||
36 | } | 39 | } |
37 | 40 | ||
38 | // expose the HLS plugin state | 41 | // expose the HLS plugin state | ... | ... |
-
Please register or sign in to post a comment