From d538debb1dec58599ae9f02263b102d0491d198c Mon Sep 17 00:00:00 2001 From: Steve Heffernan Date: Tue, 4 Mar 2014 09:29:09 -0800 Subject: [PATCH 1/6] Added try/catch to protect against IE with no Media Player --- src/js/media/html5.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/js/media/html5.js b/src/js/media/html5.js index bcf54ea4e..522804b08 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -237,6 +237,13 @@ vjs.Html5.prototype.defaultMuted = function(){ return this.el_.defaultMuted; }; /* HTML5 Support Testing ---------------------------------------------------- */ vjs.Html5.isSupported = function(){ + // ie9 with no Media Player is a LIAR! (#984) + try { + vjs.TEST_VID['volume'] = 0.5; + } catch (e) { + return false; + } + return !!vjs.TEST_VID.canPlayType; }; @@ -281,8 +288,13 @@ vjs.Html5.disposeMediaElement = function(el){ el.removeAttribute('src'); // force the media element to update its loading state by calling load() + // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793) if (typeof el.load === 'function') { - el.load(); + try { + el.load(); + } + catch(e) { + } } }; From 2005fe213625ea436a44408b3320adf85e5f821e Mon Sep 17 00:00:00 2001 From: Steve Heffernan Date: Wed, 5 Mar 2014 16:08:49 -0800 Subject: [PATCH 2/6] Exporting tech.setPoster(). Fixes #1028 --- src/js/exports.js | 2 ++ src/js/media/media.js | 8 ++++++++ test/unit/api.js | 10 ++++++++++ 3 files changed, 20 insertions(+) diff --git a/src/js/exports.js b/src/js/exports.js index c17b78ab3..ce1e16968 100644 --- a/src/js/exports.js +++ b/src/js/exports.js @@ -114,6 +114,8 @@ goog.exportProperty(vjs.MediaTechController.prototype.features, 'volumeControl', goog.exportProperty(vjs.MediaTechController.prototype.features, 'fullscreenResize', vjs.MediaTechController.prototype.features.fullscreenResize); goog.exportProperty(vjs.MediaTechController.prototype.features, 'progressEvents', vjs.MediaTechController.prototype.features.progressEvents); goog.exportProperty(vjs.MediaTechController.prototype.features, 'timeupdateEvents', vjs.MediaTechController.prototype.features.timeupdateEvents); +goog.exportProperty(vjs.MediaTechController.prototype, 'setPoster', vjs.MediaTechController.prototype.setPoster); + goog.exportSymbol('videojs.Html5', vjs.Html5); goog.exportProperty(vjs.Html5, 'Events', vjs.Html5.Events); diff --git a/src/js/media/media.js b/src/js/media/media.js index c87589017..842c75967 100644 --- a/src/js/media/media.js +++ b/src/js/media/media.js @@ -139,6 +139,14 @@ vjs.MediaTechController.prototype.onTap = function(){ this.player().userActive(!this.player().userActive()); }; +/** + * Provide a default setPoster method for techs + * + * Poster support for techs should be optional, so we don't want techs to + * break if they don't have a way to set a poster. + */ +vjs.MediaTechController.prototype.setPoster = function(){}; + vjs.MediaTechController.prototype.features = { 'volumeControl': true, diff --git a/test/unit/api.js b/test/unit/api.js index 307ab6b2e..bc8fe8d3b 100644 --- a/test/unit/api.js +++ b/test/unit/api.js @@ -83,6 +83,16 @@ test('should be able to access expected component API methods', function() { ok(comp.buildCSSClass, 'buildCSSClass exists'); }); +test('should be able to access expected MediaTech API methods', function() { + var techProto = videojs.MediaTechController.prototype; + var html5Proto = videojs.Html5.prototype; + var flashProto = videojs.Flash.prototype; + + ok(techProto.setPoster, 'setPoster should exist on the Media tech'); + ok(html5Proto.setPoster, 'setPoster should exist on the HTML5 tech'); + ok(flashProto.setPoster, 'setPoster should exist on the Flash tech'); +}); + test('should export ready api call to public', function() { var videoTag = PlayerTest.makeTag(); From e4b269e294ecfdbb94ff60ac2f175be072f7696d Mon Sep 17 00:00:00 2001 From: Steve Heffernan Date: Thu, 6 Mar 2014 12:36:36 -0800 Subject: [PATCH 3/6] Added an IIFE to prevent deoptimization --- src/js/media/html5.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/js/media/html5.js b/src/js/media/html5.js index 522804b08..0ef86fc9b 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -290,11 +290,14 @@ vjs.Html5.disposeMediaElement = function(el){ // force the media element to update its loading state by calling load() // however IE on Windows 7N has a bug that throws an error so need a try/catch (#793) if (typeof el.load === 'function') { - try { - el.load(); - } - catch(e) { - } + // wrapping in an iife so it's not deoptimized (#1060#discussion_r10324473) + (function() { + try { + el.load(); + } catch (e) { + // not supported + } + })(); } }; From 6244c3912925eaafc4657881388a7c4a067a444b Mon Sep 17 00:00:00 2001 From: Steve Heffernan Date: Thu, 6 Mar 2014 12:48:12 -0800 Subject: [PATCH 4/6] Added line to the changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fce2abc97..69ee800a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ CHANGELOG ========= ## HEAD (Unreleased) -_(none)_ +* Fixed bugs in IE9 Windows 7N with no Media Player ([view](https://github.com/videojs/video.js/pull/1060)) -------------------- From e2b2d14f4824d9d1b68aa77c2cce392063903be6 Mon Sep 17 00:00:00 2001 From: Steve Heffernan Date: Thu, 6 Mar 2014 12:55:25 -0800 Subject: [PATCH 5/6] Added line to the changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 69ee800a5..db69baf00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ CHANGELOG ## HEAD (Unreleased) * Fixed bugs in IE9 Windows 7N with no Media Player ([view](https://github.com/videojs/video.js/pull/1060)) +* Fixed a bug with setPoster() in the minified version ([view](https://github.com/videojs/video.js/pull/1062)) -------------------- From bdeaae1c9245d6c40b938292c4b00fa13659737a Mon Sep 17 00:00:00 2001 From: Steve Heffernan Date: Thu, 6 Mar 2014 13:15:53 -0800 Subject: [PATCH 6/6] Release 4.4.3 --- CHANGELOG.md | 7 +- Gruntfile.js | 2 +- contrib.json | 2 +- dist/video-js/video-js.css | 2 +- dist/video-js/video-js.less | 955 ++++++++++++++++++++++++++++ dist/video-js/video-js.min.css | 2 +- dist/video-js/video.dev.js | 25 +- dist/video-js/video.js | 218 +++---- docs/api/vjs.Flash.md | 11 + docs/api/vjs.Html5.md | 11 + docs/api/vjs.MediaTechController.md | 11 + docs/api/vjs.media.md | 2 +- package.json | 2 +- 13 files changed, 1132 insertions(+), 118 deletions(-) create mode 100644 dist/video-js/video-js.less diff --git a/CHANGELOG.md b/CHANGELOG.md index db69baf00..f6b6a0a4d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,11 +2,14 @@ CHANGELOG ========= ## HEAD (Unreleased) -* Fixed bugs in IE9 Windows 7N with no Media Player ([view](https://github.com/videojs/video.js/pull/1060)) -* Fixed a bug with setPoster() in the minified version ([view](https://github.com/videojs/video.js/pull/1062)) +_(none)_ -------------------- +## 4.4.3 (2014-03-06) +* Fixed bugs in IE9 Windows 7N with no Media Player ([view](https://github.com/videojs/video.js/pull/1060)) +* Fixed a bug with setPoster() in the minified version ([view](https://github.com/videojs/video.js/pull/1062)) + ## 4.4.2 (2014-02-24) * Fixed module.exports in minified version ([view](https://github.com/videojs/video.js/pull/1038)) diff --git a/Gruntfile.js b/Gruntfile.js index b113d1e35..944255540 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -154,7 +154,7 @@ module.exports = function(grunt) { var path = require('path'); return path.relative('dist', filepath); }, - compression: 'DEFLATE', + // compression: 'DEFLATE', src: ['dist/video-js/**/*'], dest: 'dist/video-js-' + version.full + '.zip' } diff --git a/contrib.json b/contrib.json index ee3a6b31b..2aeff575e 100644 --- a/contrib.json +++ b/contrib.json @@ -283,7 +283,7 @@ }, { "desc": "Build the release", - "exec": "grunt dist" + "exec": "grunt" }, { "desc": "Add the (otherwise ignored) release files", diff --git a/dist/video-js/video-js.css b/dist/video-js/video-js.css index 7c68a00de..68d4f794a 100644 --- a/dist/video-js/video-js.css +++ b/dist/video-js/video-js.css @@ -1,6 +1,6 @@ /*! Video.js Default Styles (http://videojs.com) -Version 4.4.1 +Version 4.4.3 Create your own skin at http://designer.videojs.com */ /* SKIN diff --git a/dist/video-js/video-js.less b/dist/video-js/video-js.less new file mode 100644 index 000000000..9663396eb --- /dev/null +++ b/dist/video-js/video-js.less @@ -0,0 +1,955 @@ +/*! +Video.js Default Styles (http://videojs.com) +Version GENERATED_AT_BUILD +Create your own skin at http://designer.videojs.com +*/ + +// To customize the player skin, change the values of the variables or edit the +// CSS below. +// (This file uses LESS. Learn more at http://lesscss.org/) + +// The base font size controls the size of everything, not just text. All +// diminensions use em-based sizes so that the scale along with the font size. +// Try increasing it to 20px and see what happens. +@base-font-size: 10px; +@touch-device-font-size: 15px; + +// The main font color controls the color of the text and the icons (font icons) +@main-font-color: #CCCCCC; // e.g. rgb(255, 255, 255) or #ffffff + +// The default color of control backgrounds is mostly black but with a little +// bit of blue so it can still be seen on all black video frames, which are +// common. +@control-bg-color: #07141E; // e.g. rgb(255, 255, 255) or #ffffff +@control-bg-alpha: 0.7; // 1.0 = 100% opacity, 0.0 = 0% opacity + +// The slider bar color is used for the progress bar and the volume bar +@slider-bar-color: #66A8CC; // e.g. rgb(255, 255, 255) or #ffffff +// The background of the progress bar and volume bar have a lined pattern that +// is created from a base64 encoded image. You can generate your own pattern at +// http://www.patternify.com/ then replace the value in the quotes with your own +@slider-bar-pattern: ~'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAYAAAAGCAYAAADgzO9IAAAAP0lEQVQIHWWMAQoAIAgDR/QJ/Ub//04+w7ZICBwcOg5FZi5iBB82AGzixEglJrd4TVK5XUJpskSTEvpdFzX9AB2pGziSQcvAAAAAAElFTkSuQmCC'; +// The color of the slider background +@slider-background-color: #333333; +@slider-background-alpha: 0.9; // 1.0 = 100% opacity, 0.0 = 0% opacity + +// The "Big Play Button" is the play button that shows before the video plays. +// To center it set the align values to center and middle. The typical location +// of the button is the center, but there is trend towards moving it to a corner +// where it gets out of the way of valuable content in the poster image. +@big-play-align: left; // left, center, or right +@big-play-vertical-align: top; // top, middle, or bottom +// The button colors match the control colors by default but you can customize +// them by replace the variables (@control-bg-color) with your own color values. +@big-play-bg-color: @control-bg-color; +@big-play-bg-alpha: @control-bg-alpha; +// The font size is what makes the big play button, big. All width/height values +// use ems, which are a multiple of the font size. +// If the @base-font-size is 10px, then 3em equals 30px. +@big-play-font-size: 3em; +// Now that font size is set, the following em values will be a multiple of the +// new font size. If @big-play-font-size is 3em (30px), then setting the any of +// the following values to 2em would equal 60px. 2 * font-size +@big-play-margin: 0.5em; +@big-play-width: 4em; +@big-play-height: 2.6em; +@big-play-border-radius: 0.8em; +@big-play-border-width: 0.1em; +@big-play-border-color: #3b4249; + +/* SKIN +================================================================================ +The main class name for all skin-specific styles. To make your own skin, +replace all occurances of 'vjs-default-skin' with a new name. Then add your new +skin name to your video tag instead of the default skin. +e.g.