Skip to content

Commit

Permalink
[2.3.2] add origin parameter to youtube
Browse files Browse the repository at this point in the history
  • Loading branch information
Jules Laplace committed Jul 10, 2014
1 parent 8b542bb commit 5d4b6c0
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = function(grunt) {
},
uglify: {
options: {
banner: '/* okvideo by okfocus ~ v2.3.1 ~ https://github.com/okfocus/okvideo */\n'
banner: '/* okvideo by okfocus ~ v2.3.3 ~ https://github.com/okfocus/okvideo */\n'
},
build: {
src: 'src/okvideo.concat.js',
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "okvideo",
"version": "2.3.2",
"version": "2.3.3",
"homepage": "http://okfoc.us/okvideo",
"authors": [
"OKFocus"
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "OKVideo",
"version": "2.3.2",
"version": "2.3.3",
"main": "./src/okvideo.js",
"dependencies": {
"jquery": ">1.7.2"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "okvideo",
"version": "2.3.2",
"version": "2.3.3",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
Expand Down
8 changes: 5 additions & 3 deletions src/okvideo.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var player, OKEvents, options;

// load the youtube api
base.loadYouTubeAPI = function (callback) {
base.insertJS('http://www.youtube.com/player_api');
base.insertJS('//www.youtube.com/player_api');
};

base.loadYouTubePlaylist = function() {
Expand All @@ -95,12 +95,13 @@ var player, OKEvents, options;
// load the vimeo api by replacing the div with an iframe and loading js
base.loadVimeoAPI = function() {
$('#okplayer').replaceWith(function() {
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>';
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>';
});

// if necessary, debug with the most recent version of froogaloop
// base.insertJS('https://rawgithub.com/vimeo/player-api/master/javascript/froogaloop.js', function(){
base.insertJS('http://a.vimeocdn.com/js/froogaloop2.min.js', function(){
// base.insertJS('http://a.vimeocdn.com/js/froogaloop2.min.js', function(){
base.insertJS('//origin-assets.vimeo.com/js/froogaloop2.min.js', function(){
vimeoPlayerReady();
});
};
Expand Down Expand Up @@ -237,6 +238,7 @@ function onYouTubePlayerAPIReady() {
'enablejsapi': 1,
'fs': 0,
'modestbranding': 1,
'origin': window.location.origin || (window.location.protocol + '//' + window.location.hostname),
'iv_load_policy': options.annotations,
'loop': options.loop,
'showinfo': 0,
Expand Down
4 changes: 2 additions & 2 deletions src/okvideo.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5d4b6c0

Please sign in to comment.