Skip to content

Commit

Permalink
Merge pull request #113 from flowplayer/develop
Browse files Browse the repository at this point in the history
Version 2.0.0
  • Loading branch information
grappler committed Apr 5, 2016
2 parents 2097480 + 4949d56 commit 3a409e8
Show file tree
Hide file tree
Showing 116 changed files with 6,709 additions and 4,061 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ Gruntfile.js export-ignore
package.json export-ignore
build.xml export-ignore
codesniffer.ruleset.xml export-ignore
composer.json export-ignore
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ results
build
.grunt

node_modules
node_modules
/vendor/
1 change: 1 addition & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ module.exports = function(grunt) {
'!.git/**',
'!Gruntfile.js',
'!package.json',
'!composer.json',
'!.gitignore',
'!.gitmodules',
'!**/.wti',
Expand Down
34 changes: 25 additions & 9 deletions admin/assets/css/admin.css
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,17 @@ select#fp5-select-skin {
border-bottom: #ccc solid 1px;;
}

.ui-tabs-active,
.nav-tab-wrapper li {
margin-bottom: 0;
}

li.ui-tabs-active,
.ui-tabs-active:hover {
color: #464646;
background: none;
border-color: #ccc solid 1px;
border-bottom: #fff solid 1px;
margin-bottom: -1px;
}

@media screen and ( max-width: 1335px ) {
Expand Down Expand Up @@ -208,20 +213,18 @@ select#fp5-select-skin {
/* Settings page */
.fp5-main {
float: left;
max-width: 742px;
}

.fp5-main form {
background: #fff;
border: 1px solid #ddd;
-webkit-box-shadow: 0 1px 2px rgba(0,0,0,0.05);
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
padding: 10px;
}

#poststuff .fp5-main h3 {
border-bottom: 1px solid #eeeeee;
padding-top: 0;
margin: 0 -10px;
.fp5-main .form-table {
border-bottom: 1px solid #ccc;
}
.fp5-main .form-table:last {
border-bottom: 0;
}

#wpbody-content .fp5-sidebar .metabox-holder {
Expand All @@ -232,10 +235,23 @@ select#fp5-select-skin {
float: right;
}

.flowplayer5_page_flowplayer5_settings #post-body.columns-2 #postbox-container-1 {
margin-right: 0;
}

#fp5_about .hndle {
cursor: default;
}

/*
* Playlist taxonomy styles
*/
/* Only works WP 4.1+ */
.taxonomy-playlist .term-parent-wrap,
.taxonomy-playlist .term-description-wrap{
display: none;
}

/*
* Sortable videos
*/
Expand Down
2 changes: 1 addition & 1 deletion admin/assets/css/admin.min.css

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

Binary file added admin/assets/img/functional.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed admin/assets/img/functional.png
Binary file not shown.
Binary file added admin/assets/img/minimalist.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed admin/assets/img/minimalist.png
Binary file not shown.
Binary file added admin/assets/img/playful.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed admin/assets/img/playful.png
Binary file not shown.
80 changes: 65 additions & 15 deletions admin/assets/js/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @package Flowplayer 5 for Wordpress
* @author Ulrich Pogson <[email protected]>
* @license GPL-2.0+
* @link http://flowplayer.org/
* @link https://flowplayer.org/
* @copyright 2013 Flowplayer Ltd
* @since 1.0.0
Expand Down Expand Up @@ -103,6 +103,12 @@ jQuery(document).ready(function ($) {
});
$('.choose-video').click(function () {
var that = $(this);
var hlsCheckbox;
if( that.attr('data-hls').length > 0 ){
hlsCheckbox = true;
} else {
hlsCheckbox = false;
}
$('input#fp5-splash-image').val(that.attr('data-img'));
$('input#fp5-mp4-video').val(that.attr('data-mp4'));
$('input#fp5-hls-video').val(that.attr('data-hls'));
Expand All @@ -114,6 +120,7 @@ jQuery(document).ready(function ($) {
$('input#fp5-data-rtmp').val(that.attr('data-rtmp'));
$('input#fp5-qualities').val(that.attr('data-qualities'));
$('input#fp5-default-quality').val(that.attr('data-default-quality'));
$("input#fp5-hls-plugin").prop('checked',hlsCheckbox);
$("input[name='post_title']").val(that.attr('data-video-name'));
$("#title-prompt-text").addClass('screen-reader-text');
$.colorbox.close();
Expand All @@ -136,12 +143,12 @@ jQuery(document).ready(function ($) {
className: 'media-frame fp5-media-frame',
frame: 'select',
multiple: false,
title: splash_image.title,
title: fp5_splash_image.title,
library: {
type: 'image'
},
button: {
text: splash_image.button
text: fp5_splash_image.button
}
});

Expand Down Expand Up @@ -172,12 +179,12 @@ jQuery(document).ready(function ($) {
className: 'media-frame fp5-media-frame',
frame: 'select',
multiple: false,
title: mp4_video.title,
title: fp5_mp4_video.title,
library: {
type: 'video/mp4'
},
button: {
text: mp4_video.button
text: fp5_mp4_video.button
}
});

Expand All @@ -204,12 +211,12 @@ jQuery(document).ready(function ($) {
className: 'media-frame fp5-media-frame',
frame: 'select',
multiple: false,
title: webm_video.title,
title: fp5_webm_video.title,
library: {
type: 'video/webm'
},
button: {
text: webm_video.button
text: fp5_webm_video.button
}
});

Expand Down Expand Up @@ -238,12 +245,12 @@ jQuery(document).ready(function ($) {
className: 'media-frame fp5-media-frame',
frame: 'select',
multiple: false,
title: ogg_video.title,
title: fp5_ogg_video.title,
library: {
type: 'video/ogg'
},
button: {
text: ogg_video.button
text: fp5_ogg_video.button
}
});

Expand Down Expand Up @@ -273,12 +280,12 @@ jQuery(document).ready(function ($) {
className: 'media-frame fp5-media-frame',
frame: 'select',
multiple: false,
title: flash_video.title,
title: fp5_flash_video.title,
library: {
type: ['video/mp4', 'video/x-flv']
},
button: {
text: flash_video.button
text: fp5_flash_video.button
}
});

Expand Down Expand Up @@ -306,18 +313,19 @@ jQuery(document).ready(function ($) {
className: 'media-frame fp5-media-frame',
frame: 'select',
multiple: false,
title: hls_video.title,
title: fp5_hls_video.title,
library: {
type: ['application/x-mpegurl']
},
button: {
text: hls_video.button
text: fp5_hls_video.button
}
});

fp5_hls_frame.on('select', function () {
var media_attachment = fp5_hls_frame.state().get('selection').first().toJSON();
$('#fp5-hls-video').val(media_attachment.url);
switchHLSCheckbox(media_attachment.url);
CreatePreview();
});
fp5_hls_frame.open();
Expand All @@ -338,12 +346,12 @@ jQuery(document).ready(function ($) {
className: 'media-frame fp5-media-frame',
frame: 'select',
multiple: false,
title: webvtt.title,
title: fp5_webvtt.title,
library: {
type: 'text/vtt'
},
button: {
text: webvtt.button
text: fp5_webvtt.button
}
});

Expand All @@ -357,4 +365,46 @@ jQuery(document).ready(function ($) {
fp5_webvtt_frame.open();
});

// Check HLS if the setting has not been set. For existing videos that do not have the setting set.
if ($(".fp5-hls-notset").length > 0){
switchHLSCheckbox($("#fp5-hls-video").val());
}

});

// Check if HLS supports CORS
var createCORSRequest = function(method, url) {
var xhr = new XMLHttpRequest();
if ("withCredentials" in xhr) {
// Most browsers.
xhr.open(method, url, true);
} else if (typeof XDomainRequest != "undefined") {
// IE8 & IE9
xhr = new XDomainRequest();
xhr.open(method, url);
} else {
// CORS not supported.
xhr = null;
}
return xhr;
};

var switchHLSCheckbox = function(url) {
var checkbox = document.getElementById("fp5-hls-plugin");
if( url.length > 0 ) {
var method = 'GET';
var xhr = createCORSRequest(method, url);

xhr.onload = function() {
checkbox.checked = true;
};

xhr.onerror = function() {
checkbox.checked = false;
};

xhr.send();
} else {
checkbox.checked = false;
}
};
Loading

0 comments on commit 3a409e8

Please sign in to comment.