diff --git a/CHANGELOG.md b/CHANGELOG.md index 8d69f153a..1f932bfc2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ CHANGELOG -------------------- +## 4.6.4 (2014-07-11) +* Fixed an issue where Flash autoplay would not show the controls ([view](https://github.com/videojs/video.js/pull/1343)) + ## 4.6.3 (2014-06-12) * Updated to version 4.4.1 of the SWF ([view](https://github.com/videojs/video.js/pull/1285)) * Fixed a minification issue with the fullscreen event. fixes #1282 ([view](https://github.com/videojs/video.js/pull/1286)) diff --git a/bower.json b/bower.json index b7d021f68..d3d437bea 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "video.js", "description": "An HTML5 and Flash video player with a common API and skin for both.", - "version": "4.6.3", + "version": "4.6.4", "main": [ "dist/video-js/video.js", "dist/video-js/video-js.css" diff --git a/component.json b/component.json index 95e25f130..8aaafc78d 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "video.js", "description": "An HTML5 and Flash video player with a common API and skin for both.", - "version": "4.6.3", + "version": "4.6.4", "keywords": [ "videojs", "html5", diff --git a/contrib.json b/contrib.json index 4e132ea02..16ebf764f 100644 --- a/contrib.json +++ b/contrib.json @@ -157,7 +157,8 @@ "type": "text" } }, - [ "git checkout stable & git pull", "Checkout and update the release branch" ], + [ "git checkout stable", "Checkout the release branch" ], + [ "git pull upstream stable", "Update the release branch" ], [ "grunt test", "Run tests" ], [ "grunt chg-release:{{ type }}", "Update the changelog with the new release" ], [ "grunt version:{{ type }}", "Bump package versions" ], @@ -166,14 +167,16 @@ [ "grunt vjsdocs", "Rebuild the docs" ], [ "grunt cdn-links", "Update the cdn urls in the docs" ], [ "grunt tagrelease", "Tag the release" ], - [ "git push origin stable", "Push changes to the remote" ], - [ "git push --tags", "Push tags to the remote" ], + [ "git push upstream stable", "Push changes to the remote" ], + [ "git push upstream --tags", "Push tags to the remote" ], [ "npm publish", "Publish to npm" ], - [ "git checkout master && git merge stable", "Checkout the development branch (master) and merge changes" ], + [ "git checkout master", "Checkout the development branch" ], + [ "git pull upstream master", "Update the development branch" ], + [ "git merge stable", "Merge changes" ], [ "grunt clean:dist", "Remove built dist files to re-ignore them" ], [ "git add -u", "Add the changes for the removed dist files" ], [ "git commit -m 'Removed dist files'", "Commit the removed dist files" ], - [ "git push origin master", "Push development branch changes" ] + [ "git push upstream master", "Push development branch changes" ] ] }, diff --git a/docs/api/vjs.Flash.md b/docs/api/vjs.Flash.md index 867640437..6dcbfbb7a 100644 --- a/docs/api/vjs.Flash.md +++ b/docs/api/vjs.Flash.md @@ -406,7 +406,7 @@ _inherited from_: [src/js/component.js#L531](https://github.com/videojs/video.js ##### PARAMETERS: * __event__ -_inherited from_: [src/js/media/media.js#L118](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L118) +_inherited from_: [src/js/media/media.js#L129](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L129) --- @@ -414,7 +414,7 @@ _inherited from_: [src/js/media/media.js#L118](https://github.com/videojs/video. > Handle a tap on the media element. By default it will toggle the user > activity state, which hides and shows the controls. -_inherited from_: [src/js/media/media.js#L138](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L138) +_inherited from_: [src/js/media/media.js#L149](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L149) --- @@ -534,7 +534,7 @@ _inherited from_: [src/js/component.js#L674](https://github.com/videojs/video.js > Remove the listeners used for click and tap controls. This is needed for > toggling to controls disabled, where a tap/touch should do nothing. -_inherited from_: [src/js/media/media.js#L102](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L102) +_inherited from_: [src/js/media/media.js#L113](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L113) --- @@ -544,7 +544,7 @@ _inherited from_: [src/js/media/media.js#L102](https://github.com/videojs/video. > 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. -_inherited from_: [src/js/media/media.js#L148](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L148) +_inherited from_: [src/js/media/media.js#L159](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L159) --- diff --git a/docs/api/vjs.Html5.md b/docs/api/vjs.Html5.md index 87b3a7c35..b82b2b374 100644 --- a/docs/api/vjs.Html5.md +++ b/docs/api/vjs.Html5.md @@ -406,7 +406,7 @@ _inherited from_: [src/js/component.js#L531](https://github.com/videojs/video.js ##### PARAMETERS: * __event__ -_inherited from_: [src/js/media/media.js#L118](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L118) +_inherited from_: [src/js/media/media.js#L129](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L129) --- @@ -414,7 +414,7 @@ _inherited from_: [src/js/media/media.js#L118](https://github.com/videojs/video. > Handle a tap on the media element. By default it will toggle the user > activity state, which hides and shows the controls. -_inherited from_: [src/js/media/media.js#L138](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L138) +_inherited from_: [src/js/media/media.js#L149](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L149) --- @@ -534,7 +534,7 @@ _inherited from_: [src/js/component.js#L674](https://github.com/videojs/video.js > Remove the listeners used for click and tap controls. This is needed for > toggling to controls disabled, where a tap/touch should do nothing. -_inherited from_: [src/js/media/media.js#L102](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L102) +_inherited from_: [src/js/media/media.js#L113](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L113) --- @@ -544,7 +544,7 @@ _inherited from_: [src/js/media/media.js#L102](https://github.com/videojs/video. > 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. -_inherited from_: [src/js/media/media.js#L148](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L148) +_inherited from_: [src/js/media/media.js#L159](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L159) --- diff --git a/docs/api/vjs.MediaTechController.md b/docs/api/vjs.MediaTechController.md index 4f08ca348..c913f6c7a 100644 --- a/docs/api/vjs.MediaTechController.md +++ b/docs/api/vjs.MediaTechController.md @@ -406,7 +406,7 @@ _inherited from_: [src/js/component.js#L531](https://github.com/videojs/video.js ##### PARAMETERS: * __event__ -_defined in_: [src/js/media/media.js#L118](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L118) +_defined in_: [src/js/media/media.js#L129](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L129) --- @@ -414,7 +414,7 @@ _defined in_: [src/js/media/media.js#L118](https://github.com/videojs/video.js/b > Handle a tap on the media element. By default it will toggle the user > activity state, which hides and shows the controls. -_defined in_: [src/js/media/media.js#L138](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L138) +_defined in_: [src/js/media/media.js#L149](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L149) --- @@ -534,7 +534,7 @@ _inherited from_: [src/js/component.js#L674](https://github.com/videojs/video.js > Remove the listeners used for click and tap controls. This is needed for > toggling to controls disabled, where a tap/touch should do nothing. -_defined in_: [src/js/media/media.js#L102](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L102) +_defined in_: [src/js/media/media.js#L113](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L113) --- @@ -544,7 +544,7 @@ _defined in_: [src/js/media/media.js#L102](https://github.com/videojs/video.js/b > 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. -_defined in_: [src/js/media/media.js#L148](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L148) +_defined in_: [src/js/media/media.js#L159](https://github.com/videojs/video.js/blob/master/src/js/media/media.js#L159) --- diff --git a/docs/api/vjs.Player.md b/docs/api/vjs.Player.md index 4e4a1776f..24988e298 100644 --- a/docs/api/vjs.Player.md +++ b/docs/api/vjs.Player.md @@ -19,7 +19,7 @@ In the follwing example, the `data-setup` attribute tells the Video.js library t ``` -After an instance has been created it can be accessed globally using `videojs('example_video_1')`. +After an instance has been created it can be accessed globally using `Video('example_video_1')`. --- @@ -920,7 +920,6 @@ _inherited from_: [src/js/component.js#L747](https://github.com/videojs/video.js --- ## EVENTS -Callback functions can be added to events by using the [`on`](#on-type-fn-) or [`one`](#one-type-fn-) methods. They can be removed from events by using the [`off`](#off-type-fn-) method. Events can be triggered manually with the [`trigger`](#trigger-type-event-) method. ### durationchange `EVENT` > Fired when the duration of the media resource is first known or changed diff --git a/package.json b/package.json index 2eab458d4..72b11b9b0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "video.js", "description": "An HTML5 and Flash video player with a common API and skin for both.", - "version": "4.6.3", + "version": "4.6.4", "copyright": "Copyright 2014 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE", "keywords": [ "videojs", @@ -21,7 +21,7 @@ }, "main": "./dist/video-js/video.js", "dependencies": { - "videojs-swf": "4.4.1" + "videojs-swf": "4.4.2" }, "devDependencies": { "calcdeps": "~0.1.7", diff --git a/src/js/media/html5.js b/src/js/media/html5.js index 66fcdb158..19dcc3cf7 100644 --- a/src/js/media/html5.js +++ b/src/js/media/html5.js @@ -29,12 +29,8 @@ vjs.Html5 = vjs.MediaTechController.extend({ var source = options['source']; - // If the element source is already set, we may have missed the loadstart event, and want to trigger it. - // We don't want to set the source again and interrupt playback. - if (source && this.el_.currentSrc === source.src && this.el_.networkState > 0) { - player.trigger('loadstart'); - // Otherwise set the source if one was provided. - } else if (source) { + // set the source if one was provided + if (source && this.el_.currentSrc !== source.src) { this.el_.src = source.src; } @@ -247,6 +243,8 @@ vjs.Html5.prototype.defaultMuted = function(){ return this.el_.defaultMuted; }; vjs.Html5.prototype.playbackRate = function(){ return this.el_.playbackRate; }; vjs.Html5.prototype.setPlaybackRate = function(val){ this.el_.playbackRate = val; }; +vjs.Html5.prototype.networkState = function(){ return this.el_.networkState; }; + /* HTML5 Support Testing ---------------------------------------------------- */ vjs.Html5.isSupported = function(){ diff --git a/src/js/media/media.js b/src/js/media/media.js index 47a69eb1e..0ea37cbea 100644 --- a/src/js/media/media.js +++ b/src/js/media/media.js @@ -61,6 +61,17 @@ vjs.MediaTechController.prototype.initControlsListeners = function(){ this.ready(activateControls); player.on('controlsenabled', activateControls); player.on('controlsdisabled', deactivateControls); + + // if we're loading the playback object after it has started loading or playing the + // video (often with autoplay on) then the loadstart event has already fired and we + // need to fire it manually because many things rely on it. + // Long term we might consider how we would do this for other events like 'canplay' + // that may also have fired. + this.ready(function(){ + if (this.networkState && this.networkState() > 0) { + this.player().trigger('loadstart'); + } + }); }; vjs.MediaTechController.prototype.addControlsListeners = function(){ @@ -161,21 +172,3 @@ vjs.MediaTechController.prototype.features = { }; vjs.media = {}; - -/** - * List of default API methods for any MediaTechController - * @type {String} - */ -vjs.media.ApiMethods = 'play,pause,paused,currentTime,setCurrentTime,duration,buffered,volume,setVolume,muted,setMuted,width,height,supportsFullScreen,enterFullScreen,src,load,currentSrc,preload,setPreload,autoplay,setAutoplay,loop,setLoop,error,networkState,readyState,seeking,initialTime,startOffsetTime,played,seekable,ended,videoTracks,audioTracks,videoWidth,videoHeight,textTracks,defaultPlaybackRate,playbackRate,mediaGroup,controller,controls,defaultMuted'.split(','); -// Create placeholder methods for each that warn when a method isn't supported by the current playback technology - -function createMethod(methodName){ - return function(){ - throw new Error('The "'+methodName+'" method is not available on the playback technology\'s API'); - }; -} - -for (var i = vjs.media.ApiMethods.length - 1; i >= 0; i--) { - var methodName = vjs.media.ApiMethods[i]; - vjs.MediaTechController.prototype[vjs.media.ApiMethods[i]] = createMethod(methodName); -}