From c62763e17403f9cc5095042ffd67877f6eeedb20 Mon Sep 17 00:00:00 2001 From: Petar Lazarov Date: Wed, 9 Dec 2015 17:44:59 +0200 Subject: [PATCH 1/5] fixes the issue with v5 and updated sources of the test --- test/example.html | 6 +++--- videojs.persistvolume.js | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/test/example.html b/test/example.html index b908722..c203d80 100644 --- a/test/example.html +++ b/test/example.html @@ -19,9 +19,9 @@ diff --git a/videojs.persistvolume.js b/videojs.persistvolume.js index 21d0fdf..4d2fde0 100644 --- a/videojs.persistvolume.js +++ b/videojs.persistvolume.js @@ -1,5 +1,5 @@ "use strict"; -(function(factory){ +(function(factory) { /*! * Custom Universal Module Definition (UMD) * @@ -107,17 +107,19 @@ setStorageItem(muteKey, player.muted()); }); - var persistedVolume = getStorageItem(key); - if(persistedVolume !== null){ - player.volume(persistedVolume); - } + player.ready(function() { + var persistedVolume = getStorageItem(key); + if(persistedVolume !== null) { + player.volume(persistedVolume); + } - var persistedMute = getStorageItem(muteKey); - if(persistedMute !== null){ - player.muted('true' === persistedMute); - } + var persistedMute = getStorageItem(muteKey); + if(persistedMute !== null) { + player.muted('true' === persistedMute); + } + }); }; vjs.plugin("persistvolume", volumePersister); -}); \ No newline at end of file +}); From 16b7289b234262fd80660564ffe872214a439103 Mon Sep 17 00:00:00 2001 From: John Boehr Date: Fri, 28 Oct 2016 17:05:25 -0700 Subject: [PATCH 2/5] Add package.json, fix issue with UMD --- package.json | 5 +++++ videojs.persistvolume.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 package.json diff --git a/package.json b/package.json new file mode 100644 index 0000000..035fc6f --- /dev/null +++ b/package.json @@ -0,0 +1,5 @@ +{ + "name": "videojs-persistvolume", + "main": "videojs.persistvolume.js", + "version": "0.1.2" +} diff --git a/videojs.persistvolume.js b/videojs.persistvolume.js index 4d2fde0..ea91dc1 100644 --- a/videojs.persistvolume.js +++ b/videojs.persistvolume.js @@ -8,7 +8,7 @@ * compiler compatible, so string keys are used. */ if (typeof define === 'function' && define['amd']) { - define(['./video'], function(vjs){ factory(window, document, vjs) }); + define(['video.js'], function(vjs){ factory(window, document, vjs) }); // checking that module is an object too because of umdjs/umd#35 } else if (typeof exports === 'object' && typeof module === 'object') { factory(window, document, require('video.js')); From e223512d9268c580e2aff15edfa05118db899865 Mon Sep 17 00:00:00 2001 From: John Boehr Date: Fri, 28 Oct 2016 17:06:02 -0700 Subject: [PATCH 3/5] Release v0.1.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 035fc6f..83f511a 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { "name": "videojs-persistvolume", "main": "videojs.persistvolume.js", - "version": "0.1.2" + "version": "0.1.3" } From d161db968d092722262eff65b7200a9a5b3fe9fb Mon Sep 17 00:00:00 2001 From: John Boehr Date: Fri, 28 Oct 2016 17:11:53 -0700 Subject: [PATCH 4/5] Fix package.json and README.md issues for npm --- README.md | 5 ++--- package.json | 8 +++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 325308e..41a431e 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,8 @@ -videojs-persistvolume -======================== +# videojs-persistvolume A plugin for Video.js that saves user's volume setting using [localStorage](https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Storage#localStorage), but falls back to cookies if necessary. -###Usage +### Usage Include the plugin: ``` diff --git a/package.json b/package.json index 83f511a..7bc1c87 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,11 @@ { "name": "videojs-persistvolume", "main": "videojs.persistvolume.js", - "version": "0.1.3" + "version": "0.1.3p1", + "license": "MIT", + "homepage": "https://github.com/jbboehr/videojs-persistvolume", + "repository": { + "type": "git", + "url": "git://github.com/jbboehr/videojs-persistvolume.git" + } } From ba1816d0815f4ec2d0de0bb319fe1fd319a9a7d6 Mon Sep 17 00:00:00 2001 From: Bryan Tong Date: Tue, 5 Dec 2017 12:08:56 -0700 Subject: [PATCH 5/5] Prefer vjs.registerPlugin over vjs.plugin --- videojs.persistvolume.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/videojs.persistvolume.js b/videojs.persistvolume.js index ea91dc1..f23e6a2 100644 --- a/videojs.persistvolume.js +++ b/videojs.persistvolume.js @@ -120,6 +120,6 @@ }); }; - vjs.plugin("persistvolume", volumePersister); + vjs[ (vjs.registerPlugin ? 'registerPlugin' : 'plugin') ]("persistvolume", volumePersister); });