Skip to content

Commit 5d4b6c0

Browse files
author
Jules Laplace
committed
[2.3.2] add origin parameter to youtube
1 parent 8b542bb commit 5d4b6c0

6 files changed

+11
-9
lines changed

Gruntfile.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = function(grunt) {
1414
},
1515
uglify: {
1616
options: {
17-
banner: '/* okvideo by okfocus ~ v2.3.1 ~ https://github.com/okfocus/okvideo */\n'
17+
banner: '/* okvideo by okfocus ~ v2.3.3 ~ https://github.com/okfocus/okvideo */\n'
1818
},
1919
build: {
2020
src: 'src/okvideo.concat.js',

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "okvideo",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"homepage": "http://okfoc.us/okvideo",
55
"authors": [
66
"OKFocus"

component.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "OKVideo",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"main": "./src/okvideo.js",
55
"dependencies": {
66
"jquery": ">1.7.2"

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "okvideo",
3-
"version": "2.3.2",
3+
"version": "2.3.3",
44
"devDependencies": {
55
"grunt": "~0.4.1",
66
"grunt-contrib-concat": "~0.3.0",

src/okvideo.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ var player, OKEvents, options;
8585

8686
// load the youtube api
8787
base.loadYouTubeAPI = function (callback) {
88-
base.insertJS('http://www.youtube.com/player_api');
88+
base.insertJS('//www.youtube.com/player_api');
8989
};
9090

9191
base.loadYouTubePlaylist = function() {
@@ -95,12 +95,13 @@ var player, OKEvents, options;
9595
// load the vimeo api by replacing the div with an iframe and loading js
9696
base.loadVimeoAPI = function() {
9797
$('#okplayer').replaceWith(function() {
98-
return '<iframe src="http://player.vimeo.com/video/' + base.options.video.id + '?api=1&title=0&byline=0&portrait=0&playbar=0&loop=' + base.options.loop + '&autoplay=' + (base.options.autoplay === 1 ? 1 : 0) + '&player_id=okplayer" frameborder="0" style="' + $(this).attr('style') + 'visibility:hidden;background-color:black;" id="' + $(this).attr('id') + '"></iframe>';
98+
return '<iframe src="//player.vimeo.com/video/' + base.options.video.id + '?api=1&title=0&byline=0&portrait=0&playbar=0&loop=' + base.options.loop + '&autoplay=' + (base.options.autoplay === 1 ? 1 : 0) + '&player_id=okplayer" frameborder="0" style="' + $(this).attr('style') + 'visibility:hidden;background-color:black;" id="' + $(this).attr('id') + '"></iframe>';
9999
});
100100

101101
// if necessary, debug with the most recent version of froogaloop
102102
// base.insertJS('https://rawgithub.com/vimeo/player-api/master/javascript/froogaloop.js', function(){
103-
base.insertJS('http://a.vimeocdn.com/js/froogaloop2.min.js', function(){
103+
// base.insertJS('http://a.vimeocdn.com/js/froogaloop2.min.js', function(){
104+
base.insertJS('//origin-assets.vimeo.com/js/froogaloop2.min.js', function(){
104105
vimeoPlayerReady();
105106
});
106107
};
@@ -237,6 +238,7 @@ function onYouTubePlayerAPIReady() {
237238
'enablejsapi': 1,
238239
'fs': 0,
239240
'modestbranding': 1,
241+
'origin': window.location.origin || (window.location.protocol + '//' + window.location.hostname),
240242
'iv_load_policy': options.annotations,
241243
'loop': options.loop,
242244
'showinfo': 0,

src/okvideo.min.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)