mirror of
https://github.com/videojs/video.js.git
synced 2024-12-29 02:57:21 +02:00
@gkatsev added error logging for bad JSON formatting. closes #2113
This commit is contained in:
parent
90b2f5d6ac
commit
fd7b997ecd
@ -24,6 +24,7 @@ CHANGELOG
|
||||
* @dconnolly exported the missing videojs.plugin function ([view](https://github.com/videojs/video.js/pull/2103))
|
||||
* @mmcc added back the captions settings styles ([view](https://github.com/videojs/video.js/pull/2112))
|
||||
* @gkatsev updated the component.js styles to match the new style guide ([view](https://github.com/videojs/video.js/pull/2105))
|
||||
* @gkatsev added error logging for bad JSON formatting ([view](https://github.com/videojs/video.js/pull/2113))
|
||||
|
||||
--------------------
|
||||
|
||||
|
1
grunt.js
1
grunt.js
@ -329,6 +329,7 @@ module.exports = function(grunt) {
|
||||
standalone: 'videojs'
|
||||
},
|
||||
banner: license,
|
||||
transform: ['babelify'],
|
||||
plugin: [
|
||||
[ 'browserify-derequire' ]
|
||||
]
|
||||
|
@ -1672,7 +1672,11 @@ class Player extends Component {
|
||||
if (dataSetup !== null){
|
||||
// Parse options JSON
|
||||
// If empty string, make it a parsable json object.
|
||||
Lib.obj.merge(tagOptions, safeParseTuple(dataSetup || '{}')[1]);
|
||||
const [err, data] = safeParseTuple(dataSetup || '{}');
|
||||
if (err) {
|
||||
Lib.log.error(err);
|
||||
}
|
||||
Lib.obj.merge(tagOptions, data);
|
||||
}
|
||||
|
||||
Lib.obj.merge(baseOptions, tagOptions);
|
||||
|
@ -104,10 +104,11 @@ class TextTrackSettings extends Component {
|
||||
}
|
||||
|
||||
restoreSettings() {
|
||||
let values;
|
||||
try {
|
||||
values = safeParseTuple(window.localStorage.getItem('vjs-text-track-settings'))[1];
|
||||
} catch (e) {}
|
||||
let [err, values] = safeParseTuple(window.localStorage.getItem('vjs-text-track-settings'));
|
||||
|
||||
if (err) {
|
||||
Lib.log.error(err);
|
||||
}
|
||||
|
||||
if (values) {
|
||||
this.setValues(values);
|
||||
|
Loading…
Reference in New Issue
Block a user