Version Description
2019/02/05 =
FV Player wp-admin menu - sorting by player date, latest first
S3 Bucket browser - improving to work well with large quantities of files. The search function was removed gone as AWS S3 doesn't have that, unfortunately.
Quality Switching - improving the label for qualities in range of 540-720p (HD if there is no higher quality, otherwise SD)
Bugfix - iOS video recovery issues in playlists
Download this release
Release Info
Developer | FolioVision |
Plugin | FV Flowplayer Video Player |
Version | 7.3.9.727 |
Comparing to | |
See all releases |
Code changes from version 7.3.7.727 to 7.3.9.727
- controller/backend.php +0 -0
- controller/frontend.php +0 -0
- css/colorbox.css +0 -0
- css/fonts/fpicons.eot +0 -0
- css/fonts/fpicons.svg +0 -0
- css/fonts/fpicons.ttf +0 -0
- css/fonts/fpicons.woff +0 -0
- css/img/exit_btn.png +0 -0
- css/img/flowplayer.png +0 -0
- css/img/no_play_white-x2.png +0 -0
- css/img/no_play_white.png +0 -0
- css/img/techinfo.png +0 -0
- css/s3-browser.css +0 -3
- flowplayer.php +2 -2
- flowplayer/embed.min.js +0 -0
- flowplayer/flowplayer.swf +0 -0
- flowplayer/flowplayerhls.swf +0 -0
- flowplayer/fv-flowplayer.min.js +19 -17
- js/s3-browser.js +50 -245
- js/shortcode-editor.js +1 -0
- models/checker.php +0 -0
- models/custom-videos.php +9 -3
- models/flowplayer-frontend.php +0 -0
- models/flowplayer.php +0 -0
- models/list-table.php +1 -1
- models/media-browser-s3.php +84 -96
- readme.txt +7 -0
- test/integration/backend/profileVideosTest.php +47 -0
- test/integration/backend/s3BrowserAjaxTest.php +61 -0
- test/integration/backend/settingsTest.php +45 -0
- test/integration/backend/testProfileScreen.html +54 -0
- test/integration/backend/testSettingsScreen.html +2073 -0
- test/integration/backend/videointelligenceInstallTest.php +80 -0
- test/integration/bootstrap.php +38 -0
- test/integration/frontend/1-shortcodesTest.php +52 -0
- test/integration/frontend/dbTest.php +121 -0
- test/integration/frontend/endActionsTest.php +164 -0
- test/integration/frontend/player-data.json +1 -0
- test/integration/frontend/shortcodesLightboxTest.php +168 -0
- test/integration/frontend/shortcodesPlaylistTest.php +156 -0
- test/integration/frontend/testSimpleShortcode.html +83 -0
- test/integration/frontend/videoPositionSavingTest.php +151 -0
- test/integration/fv-player-ajax-unittest-case.php +67 -0
- test/integration/fv-player-unittest-case.php +76 -0
- test/integration/phpunit.xml +8 -0
- test/unit/bootstrap.php +3 -0
- test/unit/controller/frontendTest.php +209 -0
- test/unit/phpunit.xml +7 -0
- test/wp-global-empty-mocks.php +225 -0
controller/backend.php
CHANGED
File without changes
|
controller/frontend.php
CHANGED
File without changes
|
css/colorbox.css
CHANGED
File without changes
|
css/fonts/fpicons.eot
CHANGED
File without changes
|
css/fonts/fpicons.svg
CHANGED
File without changes
|
css/fonts/fpicons.ttf
CHANGED
File without changes
|
css/fonts/fpicons.woff
CHANGED
File without changes
|
css/img/exit_btn.png
CHANGED
File without changes
|
css/img/flowplayer.png
CHANGED
File without changes
|
css/img/no_play_white-x2.png
CHANGED
File without changes
|
css/img/no_play_white.png
CHANGED
File without changes
|
css/img/techinfo.png
CHANGED
File without changes
|
css/s3-browser.css
CHANGED
@@ -70,7 +70,6 @@
|
|
70 |
Â
right: 0 !important;
|
71 |
Â
font-size: 17px;
|
72 |
Â
color: #ffffff !important;
|
73 |
-
display: block !important;
|
74 |
Â
width: 40px !important;
|
75 |
Â
height: 40px !important;
|
76 |
Â
}
|
@@ -132,7 +131,6 @@
|
|
132 |
Â
/* Content area */
|
133 |
Â
|
134 |
Â
.filemanager .data {
|
135 |
-
margin-top: 60px;
|
136 |
Â
z-index: -3;
|
137 |
Â
}
|
138 |
Â
.filemanager .data.animated {
|
@@ -151,7 +149,6 @@
|
|
151 |
Â
overflow: hidden;
|
152 |
Â
padding: 0.3em;
|
153 |
Â
z-index: 1;
|
154 |
-
cursor: pointer;
|
155 |
Â
box-sizing: border-box;
|
156 |
Â
border: 1px solid #ddd;
|
157 |
Â
transition: 0.3s background-color;
|
70 |
Â
right: 0 !important;
|
71 |
Â
font-size: 17px;
|
72 |
Â
color: #ffffff !important;
|
Â
|
|
73 |
Â
width: 40px !important;
|
74 |
Â
height: 40px !important;
|
75 |
Â
}
|
131 |
Â
/* Content area */
|
132 |
Â
|
133 |
Â
.filemanager .data {
|
Â
|
|
134 |
Â
z-index: -3;
|
135 |
Â
}
|
136 |
Â
.filemanager .data.animated {
|
149 |
Â
overflow: hidden;
|
150 |
Â
padding: 0.3em;
|
151 |
Â
z-index: 1;
|
Â
|
|
152 |
Â
box-sizing: border-box;
|
153 |
Â
border: 1px solid #ddd;
|
154 |
Â
transition: 0.3s background-color;
|
flowplayer.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Â
Plugin Name: FV Player
|
4 |
Â
Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
|
5 |
Â
Description: Formerly FV WordPress Flowplayer. Supports MP4, HLS, MPEG-DASH, WebM and OGV. Advanced features such as overlay ads or popups. Uses Flowplayer 7.2.7.
|
6 |
-
Version: 7.3.
|
7 |
Â
Author URI: http://foliovision.com/
|
8 |
Â
License: GPL-3.0
|
9 |
Â
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
@@ -27,7 +27,7 @@ License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
|
27 |
Â
*/
|
28 |
Â
|
29 |
Â
global $fv_wp_flowplayer_ver;
|
30 |
-
$fv_wp_flowplayer_ver = '7.3.
|
31 |
Â
$fv_wp_flowplayer_core_ver = '7.2.7.1';
|
32 |
Â
|
33 |
Â
include_once( dirname( __FILE__ ) . '/includes/extra-functions.php' );
|
3 |
Â
Plugin Name: FV Player
|
4 |
Â
Plugin URI: http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer
|
5 |
Â
Description: Formerly FV WordPress Flowplayer. Supports MP4, HLS, MPEG-DASH, WebM and OGV. Advanced features such as overlay ads or popups. Uses Flowplayer 7.2.7.
|
6 |
+
Version: 7.3.9.727
|
7 |
Â
Author URI: http://foliovision.com/
|
8 |
Â
License: GPL-3.0
|
9 |
Â
License URI: http://www.gnu.org/licenses/gpl-3.0.txt
|
27 |
Â
*/
|
28 |
Â
|
29 |
Â
global $fv_wp_flowplayer_ver;
|
30 |
+
$fv_wp_flowplayer_ver = '7.3.9.727';
|
31 |
Â
$fv_wp_flowplayer_core_ver = '7.2.7.1';
|
32 |
Â
|
33 |
Â
include_once( dirname( __FILE__ ) . '/includes/extra-functions.php' );
|
flowplayer/embed.min.js
CHANGED
File without changes
|
flowplayer/flowplayer.swf
CHANGED
File without changes
|
flowplayer/flowplayerhls.swf
CHANGED
File without changes
|
flowplayer/fv-flowplayer.min.js
CHANGED
@@ -38,9 +38,7 @@ if( typeof(fv_flowplayer_conf) != "undefined" ) {
|
|
38 |
Â
this.nextAutoLevel = nextLevel;
|
39 |
Â
}
|
40 |
Â
|
41 |
-
FVAbrController.prototype.destroy = function() {
|
42 |
-
EventHandler.prototype.destroy.call(this);
|
43 |
-
}
|
44 |
Â
|
45 |
Â
flowplayer.conf.hlsjs = {
|
46 |
Â
startLevel: -1, // todo: doesn't seem to work, fix it to pick quality matching the player size
|
@@ -2150,22 +2148,14 @@ flowplayer( function(api,root) {
|
|
2150 |
Â
var stream_info = bitrates[api.engine.dash.getQualityFor('video')];
|
2151 |
Â
if( stream_info.qualityIndex != last_quality ) {
|
2152 |
Â
last_quality = stream_info.qualityIndex;
|
2153 |
-
|
2154 |
-
for( var i in bitrates ) {
|
2155 |
-
if( bitrates[i].height < low ) low = bitrates[i].height;
|
2156 |
-
}
|
2157 |
-
quality_label(stream_info.qualityIndex,stream_info.height,low);
|
2158 |
Â
}
|
2159 |
Â
if( search.match(/dash_debug/) ) quality_debug(stream_info.width,stream_info.height,stream_info.bitrate);
|
2160 |
Â
|
2161 |
Â
} else if( api.engine.engineName == 'hlsjs-lite' ) {
|
2162 |
Â
if( hlsjs.currentLevel != last_quality ) {
|
2163 |
Â
last_quality = hlsjs.currentLevel;
|
2164 |
-
|
2165 |
-
for( var i in hlsjs.levels ) {
|
2166 |
-
if( hlsjs.levels[i].height < low ) low = hlsjs.levels[i].height;
|
2167 |
-
}
|
2168 |
-
quality_label( hlsjs.currentLevel, hlsjs.levels[hlsjs.currentLevel].height, low );
|
2169 |
Â
}
|
2170 |
Â
|
2171 |
Â
if( search.match(/hls_debug/) ) {
|
@@ -2176,13 +2166,23 @@ flowplayer( function(api,root) {
|
|
2176 |
Â
}
|
2177 |
Â
}
|
2178 |
Â
|
2179 |
-
function quality_label(index,
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
2180 |
Â
root.find('a[data-quality]').removeClass('is-current');
|
2181 |
Â
root.find('a[data-quality='+index+']').addClass('is-current');
|
2182 |
Â
var label = 'M';
|
2183 |
-
if( height >= 360 &&
|
2184 |
-
if( height
|
2185 |
-
if( height >= 1400 ) label = '4K';
|
2186 |
Â
root.find('.fp-qsel').html(label);
|
2187 |
Â
}
|
2188 |
Â
|
@@ -2738,10 +2738,12 @@ flowplayer( function(api,root) {
|
|
2738 |
Â
time_delay = 0;
|
2739 |
Â
|
2740 |
Â
api.on('load', function(e,api,video) {
|
Â
|
|
2741 |
Â
time_start = new Date().getTime();
|
2742 |
Â
});
|
2743 |
Â
|
2744 |
Â
api.on('ready', function() {
|
Â
|
|
2745 |
Â
root.find('video').on( "stalled", function(e) {} ); // could be helpful, but just using this event alone is not enough: https://github.com/flowplayer/flowplayer/issues/1403
|
2746 |
Â
|
2747 |
Â
if( api.engine.engineName == 'html5' ) {
|
38 |
Â
this.nextAutoLevel = nextLevel;
|
39 |
Â
}
|
40 |
Â
|
41 |
+
FVAbrController.prototype.destroy = function() {}
|
Â
|
|
Â
|
|
42 |
Â
|
43 |
Â
flowplayer.conf.hlsjs = {
|
44 |
Â
startLevel: -1, // todo: doesn't seem to work, fix it to pick quality matching the player size
|
2148 |
Â
var stream_info = bitrates[api.engine.dash.getQualityFor('video')];
|
2149 |
Â
if( stream_info.qualityIndex != last_quality ) {
|
2150 |
Â
last_quality = stream_info.qualityIndex;
|
2151 |
+
quality_label( stream_info.qualityIndex, bitrates );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
2152 |
Â
}
|
2153 |
Â
if( search.match(/dash_debug/) ) quality_debug(stream_info.width,stream_info.height,stream_info.bitrate);
|
2154 |
Â
|
2155 |
Â
} else if( api.engine.engineName == 'hlsjs-lite' ) {
|
2156 |
Â
if( hlsjs.currentLevel != last_quality ) {
|
2157 |
Â
last_quality = hlsjs.currentLevel;
|
2158 |
+
quality_label( hlsjs.currentLevel, hlsjs.levels );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
2159 |
Â
}
|
2160 |
Â
|
2161 |
Â
if( search.match(/hls_debug/) ) {
|
2166 |
Â
}
|
2167 |
Â
}
|
2168 |
Â
|
2169 |
+
function quality_label(index,qualities) {
|
2170 |
+
if( !qualities[index] ) return;
|
2171 |
+
|
2172 |
+
var height = qualities[index].height,
|
2173 |
+
hd_limit = 541,
|
2174 |
+
lowest = 100000;
|
2175 |
+
jQuery(qualities).each( function(k,v) {
|
2176 |
+
if( v.height >= 720 && v.height < 1400 ) hd_limit = 720;
|
2177 |
+
if( v.height < lowest ) lowest = v.height;
|
2178 |
+
});
|
2179 |
+
|
2180 |
Â
root.find('a[data-quality]').removeClass('is-current');
|
2181 |
Â
root.find('a[data-quality='+index+']').addClass('is-current');
|
2182 |
Â
var label = 'M';
|
2183 |
+
if( height >= 360 && lowest < height ) label = 'SD';
|
2184 |
+
if( height >= hd_limit ) label = 'HD';
|
2185 |
+
if( height >= 1400 ) label = '4K';
|
2186 |
Â
root.find('.fp-qsel').html(label);
|
2187 |
Â
}
|
2188 |
Â
|
2738 |
Â
time_delay = 0;
|
2739 |
Â
|
2740 |
Â
api.on('load', function(e,api,video) {
|
2741 |
+
clearInterval(no_progress);
|
2742 |
Â
time_start = new Date().getTime();
|
2743 |
Â
});
|
2744 |
Â
|
2745 |
Â
api.on('ready', function() {
|
2746 |
+
clearInterval(no_progress);
|
2747 |
Â
root.find('video').on( "stalled", function(e) {} ); // could be helpful, but just using this event alone is not enough: https://github.com/flowplayer/flowplayer/issues/1403
|
2748 |
Â
|
2749 |
Â
if( api.engine.engineName == 'html5' ) {
|
js/s3-browser.js
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
Â
jQuery( function($) {
|
2 |
Â
|
3 |
-
window.fv_player_browser = '';
|
4 |
-
|
5 |
Â
function fv_flowplayer_media_browser_add_tab(tabId, tabText, tabOnClickCallback) {
|
6 |
Â
if (!jQuery('#' + tabId).length) {
|
7 |
Â
// add Vimeo browser tab
|
@@ -18,7 +16,7 @@ jQuery( function($) {
|
|
18 |
Â
}
|
19 |
Â
};
|
20 |
Â
|
21 |
-
function fv_flowplayer_s3_browser_load_assets(bucket) {
|
22 |
Â
var
|
23 |
Â
$this = jQuery(this),
|
24 |
Â
$media_frame_content = jQuery('.media-frame-content:visible'),
|
@@ -27,7 +25,6 @@ jQuery( function($) {
|
|
27 |
Â
}),
|
28 |
Â
ajax_data = {
|
29 |
Â
action: "load_s3_assets",
|
30 |
-
cookie: encodeURIComponent(document.cookie)
|
31 |
Â
};
|
32 |
Â
|
33 |
Â
$this.addClass('active').siblings().removeClass('active')
|
@@ -36,6 +33,9 @@ jQuery( function($) {
|
|
36 |
Â
if (typeof bucket === 'string' && bucket) {
|
37 |
Â
ajax_data['bucket'] = bucket;
|
38 |
Â
}
|
Â
|
|
Â
|
|
Â
|
|
39 |
Â
|
40 |
Â
jQuery.post(ajaxurl, ajax_data, function(ret) {
|
41 |
Â
var
|
@@ -66,8 +66,7 @@ jQuery( function($) {
|
|
66 |
Â
select_html = '<strong>You have no S3 buckets configured <a href="options-general.php?page=fvplayer#postbox-container-tab_hosting">in settings</a> or none of them has complete settings (region, key ID and secret key).</strong>';
|
67 |
Â
}
|
68 |
Â
|
69 |
-
html += select_html + '</div>'
|
70 |
-
'<hr /><br />';
|
71 |
Â
}
|
72 |
Â
|
73 |
Â
if (ret.err) {
|
@@ -117,6 +116,11 @@ jQuery( function($) {
|
|
117 |
Â
$( document ).on( "mediaBrowserOpen", function(event) {
|
118 |
Â
fv_flowplayer_media_browser_add_tab('fv_flowplayer_s3_browser_media_tab', 'Amazon S3', fv_flowplayer_s3_browser_load_assets);
|
119 |
Â
});
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
120 |
Â
});
|
121 |
Â
|
122 |
Â
|
@@ -128,34 +132,21 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
128 |
Â
breadcrumbs = jQuery('.breadcrumbs'),
|
129 |
Â
fileList = filemanager.find('.data');
|
130 |
Â
|
131 |
-
// Start by fetching the file data from scan.php with an AJAX request
|
132 |
-
|
133 |
-
// jQuery.get('scan.php', function(data) {
|
134 |
-
|
135 |
Â
var response = [data],
|
136 |
Â
currentPath = '',
|
137 |
Â
breadcrumbsUrls = [];
|
138 |
Â
|
139 |
-
// console.log(response);
|
140 |
-
|
141 |
Â
var folders = [],
|
142 |
Â
files = [];
|
143 |
Â
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
// We are triggering the event. This will execute
|
152 |
-
// this function on page load, so that we show the correct folder:
|
153 |
-
|
154 |
-
}).trigger('fv-player-browser-hashchange');
|
155 |
-
|
156 |
Â
|
157 |
Â
// Hiding and showing the search box
|
158 |
-
|
159 |
Â
filemanager.find('.search').click(function(){
|
160 |
Â
|
161 |
Â
var search = jQuery(this);
|
@@ -163,7 +154,7 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
163 |
Â
search.find('span').hide();
|
164 |
Â
search.find('input[type=search]').show().focus();
|
165 |
Â
|
166 |
-
});
|
167 |
Â
|
168 |
Â
|
169 |
Â
// Listening for keyboard input on the search field.
|
@@ -188,17 +179,13 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
188 |
Â
filemanager.addClass('searching');
|
189 |
Â
|
190 |
Â
// Update the hash on every key stroke
|
191 |
-
window.
|
192 |
-
jQuery(window).trigger('fv-player-browser-hashchange');
|
193 |
-
|
194 |
Â
}
|
195 |
Â
|
196 |
Â
else {
|
197 |
Â
|
198 |
Â
filemanager.removeClass('searching');
|
199 |
-
window.
|
200 |
-
jQuery(window).trigger('fv-player-browser-hashchange');
|
201 |
-
|
202 |
Â
}
|
203 |
Â
|
204 |
Â
}).on('keyup', function(e){
|
@@ -225,121 +212,16 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
225 |
Â
var search = jQuery(this);
|
226 |
Â
|
227 |
Â
if(!search.val().trim().length) {
|
Â
|
|
228 |
Â
|
229 |
-
window.fv_player_browser = encodeURIComponent(currentPath);
|
230 |
-
jQuery(window).trigger('fv-player-browser-hashchange');
|
231 |
-
|
232 |
Â
search.hide();
|
233 |
Â
search.parent().find('span').show();
|
234 |
-
|
235 |
Â
}
|
236 |
Â
|
237 |
Â
});
|
238 |
Â
|
239 |
Â
|
240 |
-
// Clicking on folders
|
241 |
-
|
242 |
-
fileList.on('click', 'li.folders', function(e){
|
243 |
-
e.preventDefault();
|
244 |
-
|
245 |
-
var nextDir = jQuery(this).find('a.folders').attr('href');
|
246 |
-
|
247 |
-
if(filemanager.hasClass('searching')) {
|
248 |
-
|
249 |
-
// Building the breadcrumbs
|
250 |
-
|
251 |
-
breadcrumbsUrls = generateBreadcrumbs(nextDir);
|
252 |
-
|
253 |
-
filemanager.removeClass('searching');
|
254 |
-
filemanager.find('input[type=search]').val('').hide();
|
255 |
-
filemanager.find('span').show();
|
256 |
-
}
|
257 |
-
else {
|
258 |
-
breadcrumbsUrls.push(nextDir);
|
259 |
-
}
|
260 |
-
|
261 |
-
window.fv_player_browser = encodeURIComponent(nextDir);
|
262 |
-
jQuery(window).trigger('fv-player-browser-hashchange');
|
263 |
-
|
264 |
-
currentPath = nextDir;
|
265 |
-
});
|
266 |
-
|
267 |
-
|
268 |
-
// Clicking on breadcrumbs
|
269 |
-
|
270 |
-
breadcrumbs.on('click', 'a', function(e){
|
271 |
-
e.preventDefault();
|
272 |
-
|
273 |
-
var index = breadcrumbs.find('a').index(jQuery(this)),
|
274 |
-
nextDir = breadcrumbsUrls[index];
|
275 |
-
|
276 |
-
breadcrumbsUrls.length = Number(index);
|
277 |
-
|
278 |
-
window.fv_player_browser = encodeURIComponent(nextDir);
|
279 |
-
jQuery(window).trigger('fv-player-browser-hashchange');
|
280 |
-
|
281 |
-
});
|
282 |
-
|
283 |
-
|
284 |
-
// Navigates to the given hash (path)
|
285 |
-
|
286 |
-
function goto(hash) {
|
287 |
-
|
288 |
-
hash = decodeURIComponent(hash).split('=');
|
289 |
-
|
290 |
-
if (hash.length) {
|
291 |
-
var rendered = '';
|
292 |
-
|
293 |
-
// if hash has search in it
|
294 |
-
|
295 |
-
if (hash[0] === 'search') {
|
296 |
-
|
297 |
-
filemanager.addClass('searching');
|
298 |
-
rendered = searchData(response, hash[1].toLowerCase());
|
299 |
-
|
300 |
-
if (rendered.length) {
|
301 |
-
currentPath = hash[0];
|
302 |
-
render(rendered);
|
303 |
-
}
|
304 |
-
else {
|
305 |
-
render(rendered);
|
306 |
-
}
|
307 |
-
|
308 |
-
}
|
309 |
-
|
310 |
-
// if hash is some path
|
311 |
-
|
312 |
-
else if (hash[0].trim().length) {
|
313 |
-
|
314 |
-
rendered = searchByPath(hash[0]);
|
315 |
-
|
316 |
-
if (rendered.length) {
|
317 |
-
|
318 |
-
currentPath = hash[0];
|
319 |
-
breadcrumbsUrls = generateBreadcrumbs(hash[0]);
|
320 |
-
render(rendered);
|
321 |
-
|
322 |
-
}
|
323 |
-
else {
|
324 |
-
currentPath = hash[0];
|
325 |
-
breadcrumbsUrls = generateBreadcrumbs(hash[0]);
|
326 |
-
render(rendered);
|
327 |
-
}
|
328 |
-
|
329 |
-
}
|
330 |
-
|
331 |
-
// if there is no hash
|
332 |
-
|
333 |
-
else if (typeof(data) !== 'undefined' && data && data.path) {
|
334 |
-
currentPath = data.path;
|
335 |
-
breadcrumbsUrls.push(data.path);
|
336 |
-
render(searchByPath(data.path));
|
337 |
-
}
|
338 |
-
}
|
339 |
-
}
|
340 |
-
|
341 |
Â
// Splits a file path and turns it into clickable breadcrumbs
|
342 |
-
|
343 |
Â
function generateBreadcrumbs(nextDir){
|
344 |
Â
var path = nextDir.split('/').slice(0);
|
345 |
Â
for(var i=1;i<path.length;i++){
|
@@ -348,54 +230,7 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
348 |
Â
return path;
|
349 |
Â
}
|
350 |
Â
|
351 |
-
|
352 |
-
// Locates a file by path
|
353 |
-
|
354 |
-
function searchByPath(dir) {
|
355 |
-
var path = dir.split('/'),
|
356 |
-
demo = response,
|
357 |
-
flag = 0;
|
358 |
-
|
359 |
-
for(var i=0;i<path.length;i++){
|
360 |
-
for(var j=0;j<demo.length;j++){
|
361 |
-
if(demo[j] && demo[j].name === path[i]){
|
362 |
-
flag = 1;
|
363 |
-
demo = demo[j].items;
|
364 |
-
break;
|
365 |
-
}
|
366 |
-
}
|
367 |
-
}
|
368 |
-
|
369 |
-
demo = flag ? demo : [];
|
370 |
-
return demo;
|
371 |
-
}
|
372 |
-
|
373 |
-
|
374 |
-
// Recursively search through the file tree
|
375 |
-
|
376 |
-
function searchData(data, searchTerms) {
|
377 |
-
|
378 |
-
data.forEach(function(d){
|
379 |
-
if(d.type === 'folder') {
|
380 |
-
|
381 |
-
searchData(d.items,searchTerms);
|
382 |
-
|
383 |
-
if(d.name.toLowerCase().match(searchTerms)) {
|
384 |
-
folders.push(d);
|
385 |
-
}
|
386 |
-
}
|
387 |
-
else if(d.type === 'file') {
|
388 |
-
if(d.name.toLowerCase().match(searchTerms)) {
|
389 |
-
files.push(d);
|
390 |
-
}
|
391 |
-
}
|
392 |
-
});
|
393 |
-
return {folders: folders, files: files};
|
394 |
-
}
|
395 |
-
|
396 |
-
|
397 |
Â
// Render the HTML for the file manager
|
398 |
-
|
399 |
Â
function render(data) {
|
400 |
Â
|
401 |
Â
var scannedFolders = [],
|
@@ -408,25 +243,21 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
408 |
Â
if (d.type === 'folder') {
|
409 |
Â
scannedFolders.push(d);
|
410 |
Â
}
|
411 |
-
else
|
412 |
Â
scannedFiles.push(d);
|
413 |
Â
}
|
414 |
Â
|
415 |
Â
});
|
416 |
Â
|
417 |
-
}
|
418 |
-
else if(typeof data === 'object') {
|
419 |
-
|
420 |
Â
scannedFolders = data.folders;
|
421 |
Â
scannedFiles = data.files;
|
422 |
Â
|
423 |
Â
}
|
424 |
Â
|
425 |
-
|
426 |
Â
// Empty the old result and make the new one
|
427 |
-
|
428 |
Â
fileList.empty().hide();
|
429 |
-
|
430 |
Â
if(!scannedFolders.length && !scannedFiles.length) {
|
431 |
Â
filemanager.find('.nothingfound').show();
|
432 |
Â
}
|
@@ -437,27 +268,8 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
437 |
Â
if(scannedFolders.length) {
|
438 |
Â
|
439 |
Â
scannedFolders.forEach(function(f) {
|
440 |
-
|
441 |
-
|
442 |
-
name = escapeHTML(f.name),
|
443 |
-
icon = '<span class="icon folder"></span>';
|
444 |
-
|
445 |
-
if(itemsLength) {
|
446 |
-
icon = '<span class="icon folder full"></span>';
|
447 |
-
}
|
448 |
-
|
449 |
-
if(itemsLength == 1) {
|
450 |
-
itemsLength += ' item';
|
451 |
-
}
|
452 |
-
else if(itemsLength > 1) {
|
453 |
-
itemsLength += ' items';
|
454 |
-
}
|
455 |
-
else {
|
456 |
-
itemsLength = 'Empty';
|
457 |
-
}
|
458 |
-
|
459 |
-
var folder = jQuery('<li class="folders"><a href="'+ f.path +'" title="'+ name +'" class="folders">'+icon+'<span class="name">' + name + '</span> <span class="details">' + itemsLength + '</span></a></li>');
|
460 |
-
fileList.append(folder);
|
461 |
Â
});
|
462 |
Â
|
463 |
Â
}
|
@@ -498,7 +310,8 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
498 |
Â
$url_input
|
499 |
Â
.val($this.attr('href'))
|
500 |
Â
.removeClass('fv_flowplayer_target' )
|
501 |
-
.trigger('keyup')
|
Â
|
|
502 |
Â
|
503 |
Â
if( splash && $url_input.attr('id').match(/^fv_wp_flowplayer_field_src/) ) {
|
504 |
Â
var splash_input = $url_input.parents('table').find('#fv_wp_flowplayer_field_splash');
|
@@ -514,20 +327,23 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
514 |
Â
|
515 |
Â
scannedFiles.forEach(function(f) {
|
516 |
Â
|
517 |
-
var fileSize = bytesToSize(f.size),
|
518 |
Â
name = escapeHTML(f.name),
|
519 |
Â
fileType = name.split('.'),
|
520 |
-
icon = '<span class="icon file"></span>'
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
var
|
527 |
-
$href = jQuery('<a href="'+ f.link+'" title="'+ name +'" class="files">'+icon+'<span class="name">'+ name +'</span> <span class="details">'+fileSize+'</span></a>'),
|
528 |
Â
file = jQuery('<li class="files"></li>');
|
529 |
Â
|
530 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
531 |
Â
|
532 |
Â
file.append($href);
|
533 |
Â
file.appendTo(fileList);
|
@@ -537,33 +353,26 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
537 |
Â
|
538 |
Â
|
539 |
Â
// Generate the breadcrumbs
|
540 |
-
|
541 |
Â
var url = '';
|
542 |
-
|
543 |
Â
if(filemanager.hasClass('searching')){
|
544 |
-
|
545 |
Â
url = '<span>Search results: </span>';
|
546 |
Â
fileList.removeClass('animated');
|
547 |
-
|
548 |
Â
}
|
549 |
Â
else {
|
550 |
-
|
551 |
Â
fileList.addClass('animated');
|
552 |
Â
|
553 |
Â
var right_arrow = '<span class="arrow_sign">→</span> ';
|
554 |
Â
breadcrumbsUrls.forEach(function (u, i) {
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
else {
|
566 |
-
url += '<span class="folderName">' + name[name.length-1] + '</span>';
|
567 |
Â
}
|
568 |
Â
|
569 |
Â
});
|
@@ -572,11 +381,7 @@ fv_flowplayer_s3_browse = function(data, ajax_search_callback) {
|
|
572 |
Â
|
573 |
Â
breadcrumbs.text('').append(url);
|
574 |
Â
|
575 |
-
|
576 |
-
// Show the generated elements
|
577 |
-
|
578 |
Â
fileList.fadeIn();
|
579 |
-
|
580 |
Â
}
|
581 |
Â
|
582 |
Â
|
1 |
Â
jQuery( function($) {
|
2 |
Â
|
Â
|
|
Â
|
|
3 |
Â
function fv_flowplayer_media_browser_add_tab(tabId, tabText, tabOnClickCallback) {
|
4 |
Â
if (!jQuery('#' + tabId).length) {
|
5 |
Â
// add Vimeo browser tab
|
16 |
Â
}
|
17 |
Â
};
|
18 |
Â
|
19 |
+
function fv_flowplayer_s3_browser_load_assets(bucket,path) {
|
20 |
Â
var
|
21 |
Â
$this = jQuery(this),
|
22 |
Â
$media_frame_content = jQuery('.media-frame-content:visible'),
|
25 |
Â
}),
|
26 |
Â
ajax_data = {
|
27 |
Â
action: "load_s3_assets",
|
Â
|
|
28 |
Â
};
|
29 |
Â
|
30 |
Â
$this.addClass('active').siblings().removeClass('active')
|
33 |
Â
if (typeof bucket === 'string' && bucket) {
|
34 |
Â
ajax_data['bucket'] = bucket;
|
35 |
Â
}
|
36 |
+
if (typeof path === 'string' && path) {
|
37 |
+
ajax_data['path'] = path;
|
38 |
+
}
|
39 |
Â
|
40 |
Â
jQuery.post(ajaxurl, ajax_data, function(ret) {
|
41 |
Â
var
|
66 |
Â
select_html = '<strong>You have no S3 buckets configured <a href="options-general.php?page=fvplayer#postbox-container-tab_hosting">in settings</a> or none of them has complete settings (region, key ID and secret key).</strong>';
|
67 |
Â
}
|
68 |
Â
|
69 |
+
html += select_html + '</div>';
|
Â
|
|
70 |
Â
}
|
71 |
Â
|
72 |
Â
if (ret.err) {
|
116 |
Â
$( document ).on( "mediaBrowserOpen", function(event) {
|
117 |
Â
fv_flowplayer_media_browser_add_tab('fv_flowplayer_s3_browser_media_tab', 'Amazon S3', fv_flowplayer_s3_browser_load_assets);
|
118 |
Â
});
|
119 |
+
|
120 |
+
$( document ).on( "click", ".folders, .breadcrumbs a", function(event) {
|
121 |
+
fv_flowplayer_s3_browser_load_assets( jQuery('#bucket-dropdown').val(), jQuery(this).attr('href') );
|
122 |
+
return false;
|
123 |
+
});
|
124 |
Â
});
|
125 |
Â
|
126 |
Â
|
132 |
Â
breadcrumbs = jQuery('.breadcrumbs'),
|
133 |
Â
fileList = filemanager.find('.data');
|
134 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
135 |
Â
var response = [data],
|
136 |
Â
currentPath = '',
|
137 |
Â
breadcrumbsUrls = [];
|
138 |
Â
|
Â
|
|
Â
|
|
139 |
Â
var folders = [],
|
140 |
Â
files = [];
|
141 |
Â
|
142 |
+
jQuery(window).off('fv-player-browser-open-folder');
|
143 |
+
jQuery(window).on('fv-player-browser-open-folder', function(e, path){
|
144 |
+
currentPath = data.path;
|
145 |
+
breadcrumbsUrls.push(data.path);
|
146 |
+
render(data.items);
|
147 |
+
}).trigger('fv-player-browser-open-folder', [ '' ] );
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
148 |
Â
|
149 |
Â
// Hiding and showing the search box
|
Â
|
|
150 |
Â
filemanager.find('.search').click(function(){
|
151 |
Â
|
152 |
Â
var search = jQuery(this);
|
154 |
Â
search.find('span').hide();
|
155 |
Â
search.find('input[type=search]').show().focus();
|
156 |
Â
|
157 |
+
}).hide(); // not implemented for S3
|
158 |
Â
|
159 |
Â
|
160 |
Â
// Listening for keyboard input on the search field.
|
179 |
Â
filemanager.addClass('searching');
|
180 |
Â
|
181 |
Â
// Update the hash on every key stroke
|
182 |
+
jQuery(window).trigger('fv-player-browser-open-folder', [ 'search=' + value.trim() ]);
|
Â
|
|
Â
|
|
183 |
Â
}
|
184 |
Â
|
185 |
Â
else {
|
186 |
Â
|
187 |
Â
filemanager.removeClass('searching');
|
188 |
+
jQuery(window).trigger('fv-player-browser-open-folder', [ currentPath ] );
|
Â
|
|
Â
|
|
189 |
Â
}
|
190 |
Â
|
191 |
Â
}).on('keyup', function(e){
|
212 |
Â
var search = jQuery(this);
|
213 |
Â
|
214 |
Â
if(!search.val().trim().length) {
|
215 |
+
jQuery(window).trigger('fv-player-browser-open-folder', [ currentPath ] );
|
216 |
Â
|
Â
|
|
Â
|
|
Â
|
|
217 |
Â
search.hide();
|
218 |
Â
search.parent().find('span').show();
|
Â
|
|
219 |
Â
}
|
220 |
Â
|
221 |
Â
});
|
222 |
Â
|
223 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
224 |
Â
// Splits a file path and turns it into clickable breadcrumbs
|
Â
|
|
225 |
Â
function generateBreadcrumbs(nextDir){
|
226 |
Â
var path = nextDir.split('/').slice(0);
|
227 |
Â
for(var i=1;i<path.length;i++){
|
230 |
Â
return path;
|
231 |
Â
}
|
232 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
233 |
Â
// Render the HTML for the file manager
|
Â
|
|
234 |
Â
function render(data) {
|
235 |
Â
|
236 |
Â
var scannedFolders = [],
|
243 |
Â
if (d.type === 'folder') {
|
244 |
Â
scannedFolders.push(d);
|
245 |
Â
}
|
246 |
+
else {
|
247 |
Â
scannedFiles.push(d);
|
248 |
Â
}
|
249 |
Â
|
250 |
Â
});
|
251 |
Â
|
252 |
+
} else if(typeof data === 'object') {
|
Â
|
|
Â
|
|
253 |
Â
scannedFolders = data.folders;
|
254 |
Â
scannedFiles = data.files;
|
255 |
Â
|
256 |
Â
}
|
257 |
Â
|
Â
|
|
258 |
Â
// Empty the old result and make the new one
|
Â
|
|
259 |
Â
fileList.empty().hide();
|
260 |
+
|
261 |
Â
if(!scannedFolders.length && !scannedFiles.length) {
|
262 |
Â
filemanager.find('.nothingfound').show();
|
263 |
Â
}
|
268 |
Â
if(scannedFolders.length) {
|
269 |
Â
|
270 |
Â
scannedFolders.forEach(function(f) {
|
271 |
+
var name = escapeHTML(f.name).replace(/\/$/,'');
|
272 |
+
fileList.append( jQuery('<li class="folders"><a href="'+f.path+'" title="'+name+'" class="folders"><span class="icon folder"></span><span class="name">'+name+'</span></a></li>'));
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
273 |
Â
});
|
274 |
Â
|
275 |
Â
}
|
310 |
Â
$url_input
|
311 |
Â
.val($this.attr('href'))
|
312 |
Â
.removeClass('fv_flowplayer_target' )
|
313 |
+
.trigger('keyup') // this changes the HLS key field visibility in FV Player Pro
|
314 |
+
.trigger('change'); // this check the video duration etc.
|
315 |
Â
|
316 |
Â
if( splash && $url_input.attr('id').match(/^fv_wp_flowplayer_field_src/) ) {
|
317 |
Â
var splash_input = $url_input.parents('table').find('#fv_wp_flowplayer_field_splash');
|
327 |
Â
|
328 |
Â
scannedFiles.forEach(function(f) {
|
329 |
Â
|
330 |
+
var fileSize = typeof(f.size) == "number" ? bytesToSize(f.size) : f.size, // just show the size for placeholders
|
331 |
Â
name = escapeHTML(f.name),
|
332 |
Â
fileType = name.split('.'),
|
333 |
+
icon = '<span class="icon file"></span>',
|
334 |
+
fileType = fileType[fileType.length-1],
|
335 |
+
icon = '<span class="icon file f-'+fileType+'">.'+fileType+'</span>',
|
336 |
+
link = f.link ? 'href="'+ f.link+'"' : '',
|
337 |
+
$href = jQuery('<a '+link+' title="'+ name +'" class="files">'+icon+'<span class="name">'+ name +'</span> <span class="details">'+fileSize+'</span></a>'),
|
Â
|
|
Â
|
|
Â
|
|
338 |
Â
file = jQuery('<li class="files"></li>');
|
339 |
Â
|
340 |
+
if( f.link ) {
|
341 |
+
$href.on('click', fileUrlIntoShortcodeEditor);
|
342 |
+
} else { // click on placeholder
|
343 |
+
$href.on('click', function() {
|
344 |
+
return false;
|
345 |
+
});
|
346 |
+
}
|
347 |
Â
|
348 |
Â
file.append($href);
|
349 |
Â
file.appendTo(fileList);
|
353 |
Â
|
354 |
Â
|
355 |
Â
// Generate the breadcrumbs
|
Â
|
|
356 |
Â
var url = '';
|
Â
|
|
357 |
Â
if(filemanager.hasClass('searching')){
|
Â
|
|
358 |
Â
url = '<span>Search results: </span>';
|
359 |
Â
fileList.removeClass('animated');
|
Â
|
|
360 |
Â
}
|
361 |
Â
else {
|
Â
|
|
362 |
Â
fileList.addClass('animated');
|
363 |
Â
|
364 |
Â
var right_arrow = '<span class="arrow_sign">→</span> ';
|
365 |
Â
breadcrumbsUrls.forEach(function (u, i) {
|
366 |
+
var name = u.replace(/\/$/,'').split('/');
|
367 |
+
if( name.length > 1 ) {
|
368 |
+
name.forEach(function (n, k) {
|
369 |
+
var path = '';
|
370 |
+
for( var j=0; j<k+1; j++ ) {
|
371 |
+
path += name[j]+'/';
|
372 |
+
}
|
373 |
+
url += '<a href="'+path+'"><span class="folderName">'+n+'</span></a>';
|
374 |
+
if( k < name.length-1 ) url += right_arrow;
|
375 |
+
});
|
Â
|
|
Â
|
|
376 |
Â
}
|
377 |
Â
|
378 |
Â
});
|
381 |
Â
|
382 |
Â
breadcrumbs.text('').append(url);
|
383 |
Â
|
Â
|
|
Â
|
|
Â
|
|
384 |
Â
fileList.fadeIn();
|
Â
|
|
385 |
Â
}
|
386 |
Â
|
387 |
Â
|
js/shortcode-editor.js
CHANGED
@@ -798,6 +798,7 @@ function fv_flowplayer_playlist_show() {
|
|
798 |
Â
playlist_row.find('.fvp_item_video-thumbnail').html( video_preview.length ? '<img src="' + video_preview + '" />':'');
|
799 |
Â
|
800 |
Â
var video_name = decodeURIComponent(currentUrl).split("/").pop();
|
Â
|
|
801 |
Â
video_name = video_name.replace(/watch\?v=/,'YouTube: ');
|
802 |
Â
|
803 |
Â
playlist_row.find('.fvp_item_video-filename').html( video_name );
|
798 |
Â
playlist_row.find('.fvp_item_video-thumbnail').html( video_preview.length ? '<img src="' + video_preview + '" />':'');
|
799 |
Â
|
800 |
Â
var video_name = decodeURIComponent(currentUrl).split("/").pop();
|
801 |
+
video_name = video_name.replace(/\+/g,' ');
|
802 |
Â
video_name = video_name.replace(/watch\?v=/,'YouTube: ');
|
803 |
Â
|
804 |
Â
playlist_row.find('.fvp_item_video-filename').html( video_name );
|
models/checker.php
CHANGED
File without changes
|
models/custom-videos.php
CHANGED
@@ -90,8 +90,8 @@ class FV_Player_Custom_Videos {
|
|
90 |
Â
<div class='fv-player-editor-preview'>".($video ? do_shortcode($video) : '')."</div>
|
91 |
Â
<input class='attachement-shortcode fv-player-editor-field' name='fv_player_videos[".$this->meta."][]' type='hidden' value='".esc_attr($video)."' />
|
92 |
Â
<div class='edit-video' ".(!$video ? 'style="display:none"' : '').">
|
93 |
-
<button class='button fv-player-editor-button'>
|
94 |
-
<button class='button fv-player-editor-remove'>
|
95 |
Â
$add_another
|
96 |
Â
</div>
|
97 |
Â
|
@@ -444,7 +444,13 @@ class FV_Player_MetaBox {
|
|
444 |
Â
);
|
445 |
Â
}
|
446 |
Â
|
447 |
-
$args = wp_parse_args( $args, array(
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
448 |
Â
|
449 |
Â
global $FV_Player_Custom_Videos_Master;
|
450 |
Â
$FV_Player_Custom_Videos_Master->register_metabox($args);
|
90 |
Â
<div class='fv-player-editor-preview'>".($video ? do_shortcode($video) : '')."</div>
|
91 |
Â
<input class='attachement-shortcode fv-player-editor-field' name='fv_player_videos[".$this->meta."][]' type='hidden' value='".esc_attr($video)."' />
|
92 |
Â
<div class='edit-video' ".(!$video ? 'style="display:none"' : '').">
|
93 |
+
<button class='button fv-player-editor-button'>".$args['labels']['edit']."</button>
|
94 |
+
<button class='button fv-player-editor-remove'>".$args['labels']['remove']."</button>
|
95 |
Â
$add_another
|
96 |
Â
</div>
|
97 |
Â
|
444 |
Â
);
|
445 |
Â
}
|
446 |
Â
|
447 |
+
$args = wp_parse_args( $args, array(
|
448 |
+
'display' => false,
|
449 |
+
'multiple' => true,
|
450 |
+
'labels' => array(
|
451 |
+
'edit' => 'Edit Video',
|
452 |
+
'remove' => 'Remove Video'
|
453 |
+
) ) );
|
454 |
Â
|
455 |
Â
global $FV_Player_Custom_Videos_Master;
|
456 |
Â
$FV_Player_Custom_Videos_Master->register_metabox($args);
|
models/flowplayer-frontend.php
CHANGED
File without changes
|
models/flowplayer.php
CHANGED
File without changes
|
models/list-table.php
CHANGED
@@ -233,7 +233,7 @@ class FV_Player_List_Table extends WP_List_Table {
|
|
233 |
Â
|
234 |
Â
public function get_data() {
|
235 |
Â
$current = !empty($_GET['paged']) ? intval($_GET['paged']) : 1;
|
236 |
-
$order = !empty($_GET['order']) ? esc_sql($_GET['order']) : '
|
237 |
Â
$order_by = !empty($_GET['orderby']) ? esc_sql($_GET['orderby']) : 'id';
|
238 |
Â
$single_id = !empty($_GET['id']) ? esc_sql($_GET['id']) : null;
|
239 |
Â
$search = !empty($_GET['s']) ? esc_sql($_GET['s']) : null;
|
233 |
Â
|
234 |
Â
public function get_data() {
|
235 |
Â
$current = !empty($_GET['paged']) ? intval($_GET['paged']) : 1;
|
236 |
+
$order = !empty($_GET['order']) ? esc_sql($_GET['order']) : 'desc';
|
237 |
Â
$order_by = !empty($_GET['orderby']) ? esc_sql($_GET['orderby']) : 'id';
|
238 |
Â
$single_id = !empty($_GET['id']) ? esc_sql($_GET['id']) : null;
|
239 |
Â
$search = !empty($_GET['s']) ? esc_sql($_GET['s']) : null;
|
models/media-browser-s3.php
CHANGED
@@ -92,7 +92,12 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
|
|
92 |
Â
|
93 |
Â
if ($regioned_bucket_found) {
|
94 |
Â
|
95 |
-
$output = array(
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
96 |
Â
|
97 |
Â
$region = $regions[ $array_id ];
|
98 |
Â
$secret = $secrets[ $array_id ];
|
@@ -102,14 +107,20 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
|
|
102 |
Â
$credentials = new Aws\Credentials\Credentials( $key, $secret );
|
103 |
Â
|
104 |
Â
try {
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
113 |
Â
foreach( $cloudfronts['DistributionList']['Items'] AS $item ) {
|
114 |
Â
if( !$item['Enabled'] ) continue;
|
115 |
Â
|
@@ -142,27 +153,56 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
|
|
142 |
Â
) );
|
143 |
Â
|
144 |
Â
try {
|
145 |
-
$
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
150 |
Â
|
Â
|
|
151 |
Â
foreach ( $objects as $object ) {
|
152 |
Â
if ( ! isset( $objectarray ) ) {
|
153 |
Â
$objectarray = array();
|
154 |
Â
}
|
155 |
-
|
156 |
-
$
|
157 |
-
|
158 |
-
|
159 |
-
|
Â
|
|
Â
|
|
Â
|
|
160 |
Â
continue;
|
161 |
Â
}
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
166 |
Â
$link = str_replace( '%20', '+', $link );
|
167 |
Â
|
168 |
Â
// replace link with CloudFront URL, if we have one
|
@@ -173,87 +213,35 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
|
|
173 |
Â
// replace S3 URLs with bucket name as a subfolder
|
174 |
Â
$link = preg_replace('/https?:\/\/[^\/]+\/' . $bucket . '\/(.*)/i', rtrim($domains[$array_id], '/').'/$1', $link);
|
175 |
Â
}
|
176 |
-
|
177 |
-
$
|
178 |
-
|
179 |
-
|
180 |
-
$
|
181 |
-
$
|
182 |
-
|
183 |
-
}
|
184 |
-
|
185 |
-
}
|
186 |
-
|
187 |
-
function &placeInArray( array &$dest, array $path_array, $size, $pathorig, $link ) {
|
188 |
-
// If we're at the leaf of the tree, just push it to the array and return
|
189 |
-
//echo $pathorig;
|
190 |
-
//echo $size."<br>";
|
191 |
-
|
192 |
-
global $folders_added;
|
193 |
-
if ( count( $path_array ) === 1 ) {
|
194 |
-
if ( $path_array[0] !== '' ) {
|
195 |
-
$file_array = array();
|
196 |
-
$file_array['name'] = $path_array[0];
|
197 |
-
$file_array['size'] = $size;
|
198 |
-
$file_array['type'] = 'file';
|
199 |
-
$file_array['path'] = $pathorig;
|
200 |
-
$file_array['link'] = $link;
|
201 |
-
array_push( $dest['items'], $file_array );
|
202 |
-
}
|
203 |
-
|
204 |
-
return $dest;
|
205 |
Â
}
|
Â
|
|
Â
|
|
206 |
Â
|
207 |
-
|
208 |
-
|
209 |
-
$path = array_shift( $path_array );
|
210 |
-
|
211 |
-
if ( $path ) {
|
212 |
-
|
213 |
-
$newpath_temp = explode( $path, $pathorig );
|
214 |
-
$newpath = $newpath_temp[0] . $path . '/';
|
215 |
-
// ...make a new sub-array for it...
|
216 |
-
|
217 |
-
|
218 |
-
//if (!isset($dest['items'][$path])) {
|
219 |
-
if ( ! in_array( $newpath, $folders_added, true ) ) {
|
220 |
-
$dest['items'][] = array(
|
221 |
-
|
222 |
-
'name' => $path,
|
223 |
-
'type' => 'folder',
|
224 |
-
'path' => $newpath,
|
225 |
-
'items' => array()
|
226 |
-
|
227 |
-
);
|
228 |
-
$folders_added[] = $newpath;
|
229 |
-
//print_r($folders_added);
|
230 |
-
}
|
231 |
-
$count = count( $dest['items'] );
|
232 |
-
$count --;
|
233 |
-
//echo $count.'<br>';
|
234 |
-
//print_r($dest['items'][$path]);
|
235 |
-
|
236 |
-
// ...and continue the process on the sub-array
|
237 |
-
return placeInArray( $dest['items'][ $count ], $path_array, $size, $pathorig, $link );
|
238 |
Â
}
|
239 |
Â
|
240 |
-
// This is just here to blow past multiple slashes (an empty path-part), like
|
241 |
-
// /path///to///thing
|
242 |
-
return placeInArray( $dest, $path_array, $size, $pathorig, $link );
|
243 |
Â
}
|
244 |
-
|
245 |
-
$
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
Â
}
|
Â
|
|
253 |
Â
} catch ( Aws\S3\Exception\S3Exception $e ) {
|
254 |
Â
//echo $e->getMessage() . "\n";
|
255 |
Â
$err = $e->getMessage();
|
256 |
-
$output
|
257 |
Â
'items' => array(),
|
258 |
Â
'name' => '/',
|
259 |
Â
'path' => '/',
|
@@ -279,7 +267,7 @@ class FV_Player_Media_Browser_S3 extends FV_Player_Media_Browser {
|
|
279 |
Â
'active_bucket_id' => $array_id,
|
280 |
Â
'items' => (
|
281 |
Â
$regioned_bucket_found ?
|
282 |
-
$output
|
283 |
Â
array(
|
284 |
Â
'items' => array(),
|
285 |
Â
'name' => '/',
|
92 |
Â
|
93 |
Â
if ($regioned_bucket_found) {
|
94 |
Â
|
95 |
+
$output = array(
|
96 |
+
'name' => 'Home',
|
97 |
+
'type' => 'folder',
|
98 |
+
'path' => !empty($_POST['path']) ? $_POST['path'] : 'Home/',
|
99 |
+
'items' => array()
|
100 |
+
);
|
101 |
Â
|
102 |
Â
$region = $regions[ $array_id ];
|
103 |
Â
$secret = $secrets[ $array_id ];
|
107 |
Â
$credentials = new Aws\Credentials\Credentials( $key, $secret );
|
108 |
Â
|
109 |
Â
try {
|
110 |
+
$cloudfronts = get_transient('fv_player_s3_browser_cf');
|
111 |
+
if( !$cloudfronts ) {
|
112 |
+
$cfClient = Aws\CloudFront\CloudFrontClient::factory( array(
|
113 |
+
'credentials' => $credentials,
|
114 |
+
'region' => 'us-east-1',
|
115 |
+
'version' => 'latest'
|
116 |
+
) );
|
117 |
+
|
118 |
+
$cloudfronts = $cfClient->listDistributions();
|
119 |
+
if( !empty($cloudfronts['DistributionList']['Items']) ) {
|
120 |
+
set_transient('fv_player_s3_browser_cf',$cloudfronts,60);
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
Â
foreach( $cloudfronts['DistributionList']['Items'] AS $item ) {
|
125 |
Â
if( !$item['Enabled'] ) continue;
|
126 |
Â
|
153 |
Â
) );
|
154 |
Â
|
155 |
Â
try {
|
156 |
+
$args = array(
|
157 |
+
'Bucket' => $bucket,
|
158 |
+
'Delimiter' => '/',
|
159 |
+
);
|
160 |
+
|
161 |
+
$request_path = !empty($_POST['path']) ? str_replace( 'Home/', '', stripslashes($_POST['path']) ) : false;
|
162 |
+
|
163 |
+
if( $request_path ) {
|
164 |
+
$args['Prefix'] = $request_path;
|
165 |
+
}
|
166 |
+
|
167 |
+
$res = $s3Client->ListObjects( $args );
|
168 |
+
$objects = array_merge( !empty($res['CommonPrefixes']) ? $res['CommonPrefixes'] : array(), $res->get('Contents') );
|
169 |
+
|
170 |
+
if( isset($_REQUEST['debug']) ) {
|
171 |
+
var_dump($args,$objects);
|
172 |
+
die();
|
173 |
+
}
|
174 |
Â
|
175 |
+
$sum_up = array();
|
176 |
Â
foreach ( $objects as $object ) {
|
177 |
Â
if ( ! isset( $objectarray ) ) {
|
178 |
Â
$objectarray = array();
|
179 |
Â
}
|
180 |
+
|
181 |
+
$item = array();
|
182 |
+
|
183 |
+
$path = $object['Prefix'] ? $object['Prefix'] : $object['Key'];
|
184 |
+
|
185 |
+
if( !empty($object['Key']) && preg_match( '~\.ts$~', $object['Key'] ) ) {
|
186 |
+
if( empty($sum_up['ts']) ) $sum_up['ts'] = 0;
|
187 |
+
$sum_up['ts']++;
|
188 |
Â
continue;
|
189 |
Â
}
|
190 |
+
|
191 |
+
$item['path'] = 'Home/' . $path;
|
192 |
+
|
193 |
+
if( $request_path ) {
|
194 |
+
if( $request_path == $path ) continue; // sometimes the current folder is present in the response, weird
|
195 |
+
|
196 |
+
$item['name'] = str_replace( $request_path, '', $path );
|
197 |
+
} else {
|
198 |
+
$item['name'] = $path;
|
199 |
+
}
|
200 |
+
|
201 |
+
if( !empty($object['Size']) ) {
|
202 |
+
$item['type'] = 'file';
|
203 |
+
$item['size'] = $object['Size'];
|
204 |
+
|
205 |
+
$link = (string) $s3Client->getObjectUrl( $bucket, $path );
|
206 |
Â
$link = str_replace( '%20', '+', $link );
|
207 |
Â
|
208 |
Â
// replace link with CloudFront URL, if we have one
|
213 |
Â
// replace S3 URLs with bucket name as a subfolder
|
214 |
Â
$link = preg_replace('/https?:\/\/[^\/]+\/' . $bucket . '\/(.*)/i', rtrim($domains[$array_id], '/').'/$1', $link);
|
215 |
Â
}
|
216 |
+
|
217 |
+
$item['link'] = $link;
|
218 |
+
|
219 |
+
} else {
|
220 |
+
$item['type'] = 'folder';
|
221 |
+
$item['items'] = array();
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
222 |
Â
}
|
223 |
+
|
224 |
+
$output['items'][] = $item;
|
225 |
Â
|
226 |
+
if (strtolower(substr($name, strrpos($name, '.') + 1)) === 'ts') {
|
227 |
+
continue;
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
228 |
Â
}
|
229 |
Â
|
Â
|
|
Â
|
|
Â
|
|
230 |
Â
}
|
231 |
+
|
232 |
+
foreach( $sum_up AS $ext => $count ) {
|
233 |
+
$output['items'][] = array(
|
234 |
+
'name' => '*.ts',
|
235 |
+
'link' => '',
|
236 |
+
'size' => $count.' .'.$ext.' files hidden',
|
237 |
+
'type' => 'placeholder'
|
238 |
+
);
|
239 |
Â
}
|
240 |
+
|
241 |
Â
} catch ( Aws\S3\Exception\S3Exception $e ) {
|
242 |
Â
//echo $e->getMessage() . "\n";
|
243 |
Â
$err = $e->getMessage();
|
244 |
+
$output = array(
|
245 |
Â
'items' => array(),
|
246 |
Â
'name' => '/',
|
247 |
Â
'path' => '/',
|
267 |
Â
'active_bucket_id' => $array_id,
|
268 |
Â
'items' => (
|
269 |
Â
$regioned_bucket_found ?
|
270 |
+
$output :
|
271 |
Â
array(
|
272 |
Â
'items' => array(),
|
273 |
Â
'name' => '/',
|
readme.txt
CHANGED
@@ -357,6 +357,13 @@ Thank you for being part of the HMTL 5 mobile video revolution!
|
|
357 |
Â
|
358 |
Â
== Changelog ==
|
359 |
Â
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
360 |
Â
= 7.3.7.727 - 2019/01/24 =
|
361 |
Â
|
362 |
Â
* Database - performance fix
|
357 |
Â
|
358 |
Â
== Changelog ==
|
359 |
Â
|
360 |
+
= 7.3.9.727 - 2019/02/05 =
|
361 |
+
|
362 |
+
* FV Player wp-admin menu - sorting by player date, latest first
|
363 |
+
* S3 Bucket browser - improving to work well with large quantities of files. The search function was removed gone as AWS S3 doesn't have that, unfortunately.
|
364 |
+
* Quality Switching - improving the label for qualities in range of 540-720p (HD if there is no higher quality, otherwise SD)
|
365 |
+
* Bugfix - iOS video recovery issues in playlists
|
366 |
+
|
367 |
Â
= 7.3.7.727 - 2019/01/24 =
|
368 |
Â
|
369 |
Â
* Database - performance fix
|
test/integration/backend/profileVideosTest.php
ADDED
@@ -0,0 +1,47 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_ProfileVideosTestCase extends FV_Player_UnitTestCase {
|
10 |
+
|
11 |
+
public function testProfileScreen() {
|
12 |
+
global $fv_fp;
|
13 |
+
$fv_fp->conf['profile_videos_enable_bio'] = true;
|
14 |
+
|
15 |
+
// add new user and create last saved position metadata for this new user
|
16 |
+
$this->userID = $this->factory->user->create(array(
|
17 |
+
'role' => 'admin'
|
18 |
+
));
|
19 |
+
|
20 |
+
add_user_meta($this->userID, '_fv_player_user_video', '[fvplayer src="https://vimeo.com/255317467" playlist="https://vimeo.com/192934117" caption=";Talking about FV Player"]');
|
21 |
+
add_user_meta($this->userID, '_fv_player_user_video', '[fvplayer src="https://vimeo.com/255370388"]');
|
22 |
+
add_user_meta($this->userID, '_fv_player_user_video', '[fvplayer src="https://www.youtube.com/watch?v=6ZfuNTqbHE8"]]');
|
23 |
+
|
24 |
+
$profileuser = get_user_to_edit($this->userID);
|
25 |
+
|
26 |
+
ob_start();
|
27 |
+
apply_filters( 'show_password_fields', true, $profileuser );
|
28 |
+
$output = ob_get_clean();
|
29 |
+
|
30 |
+
$one = $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testProfileScreen.html')); // this contains user ID of '4'
|
31 |
+
$two = explode("\n",$this->fix_newlines($output));
|
32 |
+
foreach( explode("\n",$one) as $k => $v ) {
|
33 |
+
|
34 |
+
/*if( $v != $two[$k]) {
|
35 |
+
for($i=0;$i<strlen($two[$k]);$i++) {
|
36 |
+
var_dump( $two[$k][$i].' '.ord($two[$k][$i]) );
|
37 |
+
}
|
38 |
+
}*/
|
39 |
+
|
40 |
+
//$this->assertEquals( $v, $two[$k] );
|
41 |
+
}
|
42 |
+
|
43 |
+
$this->assertEquals( $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testProfileScreen.html')), $this->fix_newlines($output) );
|
44 |
+
|
45 |
+
}
|
46 |
+
|
47 |
+
}
|
test/integration/backend/s3BrowserAjaxTest.php
ADDED
@@ -0,0 +1,61 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-ajax-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_S3BrowserAjaxTestCase extends FV_Player_Ajax_UnitTestCase {
|
10 |
+
|
11 |
+
// we need to make sure FV Player loads as if it's wp-admin
|
12 |
+
public static function wpSetUpBeforeClass() {
|
13 |
+
global $fv_fp;
|
14 |
+
|
15 |
+
$_POST = array (
|
16 |
+
'amazon_bucket' => array(FV_PLAYER_AMAZON_BUCKET),
|
17 |
+
's3_browser' => 1,
|
18 |
+
'fv-wp-flowplayer-submit' => 'Save All Changes'
|
19 |
+
);
|
20 |
+
|
21 |
+
set_current_screen( 'edit-post' );
|
22 |
+
// without this included, fv_wp_flowplayer_delete_extensions_transients() would not be found
|
23 |
+
include_once "../../../fv-wordpress-flowplayer/controller/backend.php";
|
24 |
+
parent::wpSetUpBeforeClass();
|
25 |
+
|
26 |
+
$fv_fp->_set_conf();
|
27 |
+
}
|
28 |
+
|
29 |
+
public function setUp() {
|
30 |
+
parent::setUp();
|
31 |
+
}
|
32 |
+
|
33 |
+
public function testNoSaveForNotLoggedInUsers() {
|
34 |
+
global $fv_fp;
|
35 |
+
|
36 |
+
//$fv_fp->conf['amazon_bucket'] = array(FV_PLAYER_AMAZON_BUCKET);
|
37 |
+
$fv_fp->conf['amazon_region'] = array(FV_PLAYER_AMAZON_REGION);
|
38 |
+
$fv_fp->conf['amazon_key'] = array(FV_PLAYER_AMAZON_ACCESS_KEY);
|
39 |
+
$fv_fp->conf['amazon_secret'] = array(FV_PLAYER_AMAZON_SECRET);
|
40 |
+
|
41 |
+
// is anybody listening out there?
|
42 |
+
$this->assertTrue( has_action('wp_ajax_load_s3_assets') );
|
43 |
+
|
44 |
+
// Spoof the nonce in the POST superglobal
|
45 |
+
//$_POST['_wpnonce'] = wp_create_nonce( 'anything-here-if-needed' );
|
46 |
+
|
47 |
+
// set up POST data for video resume times
|
48 |
+
// $_POST['action'] = 'fv_wp_flowplayer_video_position_save';
|
49 |
+
|
50 |
+
// call the AJAX which
|
51 |
+
try {
|
52 |
+
$this->_handleAjax( 'fv_wp_flowplayer_ajax_load_s3_assets' );
|
53 |
+
} catch ( WPAjaxDieContinueException $e ) {
|
54 |
+
$response = json_decode( $this->_last_response );
|
55 |
+
$this->assertInternalType( 'object', $response );
|
56 |
+
$this->assertObjectHasAttribute( 'success', $response );
|
57 |
+
$this->assertFalse( $response->success );
|
58 |
+
}
|
59 |
+
}
|
60 |
+
|
61 |
+
}
|
test/integration/backend/settingsTest.php
ADDED
@@ -0,0 +1,45 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_SettingsTestCase extends FV_Player_UnitTestCase {
|
10 |
+
|
11 |
+
// we need to convince it is showing the FV Player settings screen!
|
12 |
+
public static function wpSetUpBeforeClass() {
|
13 |
+
set_current_screen( 'settings_page_fvplayer' );
|
14 |
+
|
15 |
+
parent::wpSetUpBeforeClass();
|
16 |
+
|
17 |
+
remove_action( 'admin_init', 'wp_admin_headers' );
|
18 |
+
do_action( 'admin_init' );
|
19 |
+
}
|
20 |
+
|
21 |
+
public function testSettingsScreen() {
|
22 |
+
|
23 |
+
ob_start();
|
24 |
+
fv_player_admin_page();
|
25 |
+
$output = ob_get_clean();
|
26 |
+
|
27 |
+
$one = $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testSettingsScreen.html'));
|
28 |
+
$two = explode("\n",$this->fix_newlines($output));
|
29 |
+
foreach( explode("\n",$one) as $k => $v ) {
|
30 |
+
|
31 |
+
/*if( $v != $two[$k]) {
|
32 |
+
for($i=0;$i<strlen($two[$k]);$i++) {
|
33 |
+
if( $v[$i] != $two[$k][$i]) {
|
34 |
+
var_dump( $v[$i].' vs '.$two[$k][$i].' '.ord($two[$k][$i]) );
|
35 |
+
}
|
36 |
+
}
|
37 |
+
}*/
|
38 |
+
|
39 |
+
$this->assertEquals( $v, $two[$k] );
|
40 |
+
}
|
41 |
+
|
42 |
+
$this->assertEquals( $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testSettingsScreen.html')), $this->fix_newlines($output) );
|
43 |
+
}
|
44 |
+
|
45 |
+
}
|
test/integration/backend/testProfileScreen.html
ADDED
@@ -0,0 +1,54 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<tr class="user-videos">
|
2 |
+
<th>Videos</th>
|
3 |
+
<td>
|
4 |
+
<div class="fv-player-custom-video-list"><form method='POST'><div class="fv-player-custom-video"><div class='fv-player-editor-wrapper' data-key='fv-player-editor-field-_fv_player_user_video'>
|
5 |
+
<div class='inside inside-child'>
|
6 |
+
<div class='fv-player-editor-preview'><iframe id='fv_vimeo_40a1ea9c2827d8afc50536475564effe' src='//player.vimeo.com/video/255317467' width='640' height='360' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
7 |
+
</div>
|
8 |
+
<input class='attachement-shortcode fv-player-editor-field' name='fv_player_videos[_fv_player_user_video][]' type='hidden' value='[fvplayer src="https://vimeo.com/255317467" playlist="https://vimeo.com/192934117" caption=";Talking about FV Player"]' />
|
9 |
+
<div class='edit-video' >
|
10 |
+
<button class='button fv-player-editor-button'>Edit Video</button>
|
11 |
+
<button class='button fv-player-editor-remove'>Remove Video</button>
|
12 |
+
<button class='button fv-player-editor-more' style='display:none'>Add Another Video</button>
|
13 |
+
</div>
|
14 |
+
|
15 |
+
<div class='add-video' style="display:none">
|
16 |
+
<button class='button fv-player-editor-button'>Add Video</button>
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
</div><div class='fv-player-editor-wrapper' data-key='fv-player-editor-field-_fv_player_user_video'>
|
20 |
+
<div class='inside inside-child'>
|
21 |
+
<div class='fv-player-editor-preview'><iframe id='fv_vimeo_611247c19e9196fbf9433d589da255e1' src='//player.vimeo.com/video/255370388' width='640' height='360' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
22 |
+
</div>
|
23 |
+
<input class='attachement-shortcode fv-player-editor-field' name='fv_player_videos[_fv_player_user_video][]' type='hidden' value='[fvplayer src="https://vimeo.com/255370388"]' />
|
24 |
+
<div class='edit-video' >
|
25 |
+
<button class='button fv-player-editor-button'>Edit Video</button>
|
26 |
+
<button class='button fv-player-editor-remove'>Remove Video</button>
|
27 |
+
<button class='button fv-player-editor-more' style='display:none'>Add Another Video</button>
|
28 |
+
</div>
|
29 |
+
|
30 |
+
<div class='add-video' style="display:none">
|
31 |
+
<button class='button fv-player-editor-button'>Add Video</button>
|
32 |
+
</div>
|
33 |
+
</div>
|
34 |
+
</div><div class='fv-player-editor-wrapper' data-key='fv-player-editor-field-_fv_player_user_video'>
|
35 |
+
<div class='inside inside-child'>
|
36 |
+
<div class='fv-player-editor-preview'><iframe id='fv_ytplayer_5fc2c295c1c8d43b356a8b8ee0c122ca' type='text/html' width='640' height='360'
|
37 |
+
src='//www.youtube.com/embed/6ZfuNTqbHE8?origin=' frameborder='0' webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
|
38 |
+
]</div>
|
39 |
+
<input class='attachement-shortcode fv-player-editor-field' name='fv_player_videos[_fv_player_user_video][]' type='hidden' value='[fvplayer src="https://www.youtube.com/watch?v=6ZfuNTqbHE8"]]' />
|
40 |
+
<div class='edit-video' >
|
41 |
+
<button class='button fv-player-editor-button'>Edit Video</button>
|
42 |
+
<button class='button fv-player-editor-remove'>Remove Video</button>
|
43 |
+
<button class='button fv-player-editor-more' style='display:none'>Add Another Video</button>
|
44 |
+
</div>
|
45 |
+
|
46 |
+
<div class='add-video' style="display:none">
|
47 |
+
<button class='button fv-player-editor-button'>Add Video</button>
|
48 |
+
</div>
|
49 |
+
</div>
|
50 |
+
</div><div style="clear: both"></div>
|
51 |
+
</div>
|
52 |
+
<input type='hidden' name='fv-player-custom-videos-entity-id[_fv_player_user_video]' value='4' /><input type='hidden' name='fv-player-custom-videos-entity-type[_fv_player_user_video]' value='user' /><input type="hidden" id="fv-player-custom-videos-_fv_player_user_video-0" name="fv-player-custom-videos-_fv_player_user_video-0" value="0926bc6617" /><input type="hidden" name="_wp_http_referer" value="" /><input type='hidden' name='action' value='fv-player-custom-videos-save' /><input type='submit' value='Save Videos' /></form></div> <p class="description">You can put your Vimeo or YouTube links here. <abbr title="These show up as a part of the user bio. Licensed users get FV Player Pro which embeds these video types in FV Player interface without Vimeo or YouTube interface showing up."><span class="dashicons dashicons-editor-help"></span></abbr></p>
|
53 |
+
</td>
|
54 |
+
</tr>
|
test/integration/backend/testSettingsScreen.html
ADDED
@@ -0,0 +1,2073 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
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â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<div class="wrap">
|
2 |
+
<div style="position: absolute; margin-top: 10px; right: 10px;">
|
3 |
+
<a href="https://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer" target="_blank" title="Documentation"><img alt="visit foliovision" src="//foliovision.com/shared/fv-logo.png" /></a>
|
4 |
+
</div>
|
5 |
+
<div>
|
6 |
+
<div id="icon-options-general" class="icon32"></div>
|
7 |
+
<h2>FV Player</h2>
|
8 |
+
</div>
|
9 |
+
|
10 |
+
|
11 |
+
<form id="wpfp_options" method="post" action="">
|
12 |
+
|
13 |
+
<p id="fv_flowplayer_admin_buttons">
|
14 |
+
<input type="button" class="button fv-license-inactive" onclick="fv_flowplayer_ajax_check('fv_wp_flowplayer_check_license'); return false" value="Apply Pro upgrade" />
|
15 |
+
<input type="button" class="button" onclick="fv_flowplayer_ajax_check('fv_wp_flowplayer_check_template'); return false" value="Check template" />
|
16 |
+
<input type="button" class="button" onclick="fv_flowplayer_ajax_check('fv_wp_flowplayer_check_files')" value="Check videos" />
|
17 |
+
|
18 |
+
<input type="text" name="key" id="key" placeholder="Commercial License Key" value="" /> <a title="Click here for license info" target="_blank" href="https://foliovision.com/player/download"><span class="dashicons dashicons-editor-help"></span></a>
|
19 |
+
|
20 |
+
<img class="fv_wp_flowplayer_check_license-spin" style="display: none; " src="http://example.org/wp-includes/images/wpspin.gif" width="16" height="16" />
|
21 |
+
<img class="fv_wp_flowplayer_check_template-spin" style="display: none; " src="http://example.org/wp-includes/images/wpspin.gif" width="16" height="16" />
|
22 |
+
<img class="fv_wp_flowplayer_check_files-spin" style="display: none; " src="http://example.org/wp-includes/images/wpspin.gif" width="16" height="16" />
|
23 |
+
</p>
|
24 |
+
<div id="fv_flowplayer_admin_notices">
|
25 |
+
</div>
|
26 |
+
|
27 |
+
<div id="fv_flowplayer_ad">
|
28 |
+
<div class="text-part">
|
29 |
+
<h2>FV Wordpress<strong>Flowplayer</strong></h2>
|
30 |
+
<span class="red-text">with your own branding</span>
|
31 |
+
<ul>
|
32 |
+
<li>Put up your own logo</li>
|
33 |
+
<li>Or remove the logo completely</li>
|
34 |
+
<li>The best video plugin for Wordpress</li>
|
35 |
+
</ul>
|
36 |
+
<a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download" class="red-button"><strong>Easter sale!</strong><br />All Licenses 20% Off</a></p>
|
37 |
+
</div>
|
38 |
+
<div class="graphic-part">
|
39 |
+
<a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/buy">
|
40 |
+
<img width="297" height="239" border="0" src="http://example.org/wp-content/plugins/fv-wordpress-flowplayer/images/fv-wp-flowplayer-led-monitor.png"> </a>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
<div id="fv_flowplayer_admin_tabs">
|
45 |
+
<h2 class="fv-nav-tab-wrapper nav-tab-wrapper">
|
46 |
+
<a href="#postbox-container-tab_basic" class="nav-tab nav-tab-active" style="outline: 0px;">Setup</a>
|
47 |
+
<a href="#postbox-container-tab_skin" class="nav-tab" style="outline: 0px;">Skin</a>
|
48 |
+
<a href="#postbox-container-tab_hosting" class="nav-tab" style="outline: 0px;">Hosting</a>
|
49 |
+
<a href="#postbox-container-tab_actions" class="nav-tab" style="outline: 0px;">Actions</a>
|
50 |
+
<a href="#postbox-container-tab_video_intelligence" class="nav-tab" style="outline: 0px;">vi Ads</a>
|
51 |
+
<a href="#postbox-container-tab_help" class="nav-tab" style="outline: 0px;">Help</a>
|
52 |
+
<div id="fv_player_js_warning" style=" margin: 8px 40px; display: inline-block; color: darkgrey;" >There Is a Problem with JavaScript.</div>
|
53 |
+
</h2>
|
54 |
+
</div>
|
55 |
+
|
56 |
+
<div id="dashboard-widgets" class="metabox-holder fv-metabox-holder columns-1">
|
57 |
+
<div id='postbox-container-tab_basic' class='postbox-container'>
|
58 |
+
<div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
|
59 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: </span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span> </span></h2>
|
60 |
+
<div class="inside">
|
61 |
+
<table class="form-table">
|
62 |
+
<tr>
|
63 |
+
<td colspan="4">
|
64 |
+
<p>
|
65 |
+
FV Player is a free, easy-to-use, and complete solution for embedding <strong>MP4</strong>, <strong>WEBM</strong>, <strong>OGV</strong>, <strong>MOV</strong>
|
66 |
+
and <strong>FLV</strong>
|
67 |
+
videos into your posts or pages. With MP4 videos, FV Player offers 98% coverage even on mobile devices. </p>
|
68 |
+
</td>
|
69 |
+
</tr>
|
70 |
+
</table>
|
71 |
+
</div>
|
72 |
+
</div>
|
73 |
+
<div id="fv_flowplayer_interface_options" class="postbox " >
|
74 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Post Interface Options</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Post Interface Options</span></h2>
|
75 |
+
<div class="inside">
|
76 |
+
<p>Which features should be available in shortcode editor?</p>
|
77 |
+
<table class="form-table2">
|
78 |
+
<tr>
|
79 |
+
<td class="first"><label for="interface[ads]">Ads:</label></td>
|
80 |
+
<td>
|
81 |
+
<p class="description">
|
82 |
+
<input type="hidden" name="interface[ads]" value="false"/>
|
83 |
+
<input type="checkbox" name="interface[ads]" id="interface[ads]" value="true" />
|
84 |
+
</p>
|
85 |
+
</td>
|
86 |
+
</tr>
|
87 |
+
<tr>
|
88 |
+
<td class="first"><label for="interface[align]">Align:</label></td>
|
89 |
+
<td>
|
90 |
+
<p class="description">
|
91 |
+
<input type="hidden" name="interface[align]" value="false"/>
|
92 |
+
<input type="checkbox" name="interface[align]" id="interface[align]" value="true" />
|
93 |
+
</p>
|
94 |
+
</td>
|
95 |
+
</tr>
|
96 |
+
<tr>
|
97 |
+
<td class="first"><label for="allowuploads">Allow Video Uploads:</label></td>
|
98 |
+
<td>
|
99 |
+
<p class="description">
|
100 |
+
<input type="hidden" name="allowuploads" value="false"/>
|
101 |
+
<input type="checkbox" name="allowuploads" id="allowuploads" value="true" checked="checked" />
|
102 |
+
Enables the WP Media Library integraton if you want to host videos on your own server </p>
|
103 |
+
</td>
|
104 |
+
</tr>
|
105 |
+
<tr>
|
106 |
+
<td class="first"><label for="interface[autoplay]">Autoplay:</label></td>
|
107 |
+
<td>
|
108 |
+
<p class="description">
|
109 |
+
<input type="hidden" name="interface[autoplay]" value="false"/>
|
110 |
+
<input type="checkbox" name="interface[autoplay]" id="interface[autoplay]" value="true" />
|
111 |
+
</p>
|
112 |
+
</td>
|
113 |
+
</tr>
|
114 |
+
<tr>
|
115 |
+
<td class="first"><label for="interface[controlbar]">Controlbar:</label></td>
|
116 |
+
<td>
|
117 |
+
<p class="description">
|
118 |
+
<input type="hidden" name="interface[controlbar]" value="false"/>
|
119 |
+
<input type="checkbox" name="interface[controlbar]" id="interface[controlbar]" value="true" />
|
120 |
+
</p>
|
121 |
+
</td>
|
122 |
+
</tr>
|
123 |
+
<tr>
|
124 |
+
<td class="first"><label for="interface[embed]">Embed:</label></td>
|
125 |
+
<td>
|
126 |
+
<p class="description">
|
127 |
+
<input type="hidden" name="interface[embed]" value="false"/>
|
128 |
+
<input type="checkbox" name="interface[embed]" id="interface[embed]" value="true" />
|
129 |
+
</p>
|
130 |
+
</td>
|
131 |
+
</tr>
|
132 |
+
<tr>
|
133 |
+
<td class="first"><label for="interface[live]">Live Stream:</label></td>
|
134 |
+
<td>
|
135 |
+
<p class="description">
|
136 |
+
<input type="hidden" name="interface[live]" value="false"/>
|
137 |
+
<input type="checkbox" name="interface[live]" id="interface[live]" value="true" />
|
138 |
+
</p>
|
139 |
+
</td>
|
140 |
+
</tr>
|
141 |
+
<tr>
|
142 |
+
<td class="first"><label for="interface[mobile]">Mobile Video:</label></td>
|
143 |
+
<td>
|
144 |
+
<p class="description">
|
145 |
+
<input type="hidden" name="interface[mobile]" value="false"/>
|
146 |
+
<input type="checkbox" name="interface[mobile]" id="interface[mobile]" value="true" />
|
147 |
+
</p>
|
148 |
+
</td>
|
149 |
+
</tr>
|
150 |
+
<tr>
|
151 |
+
<td class="first"><label for="interface[playlist_advance]">Playlist Auto Advance:</label></td>
|
152 |
+
<td>
|
153 |
+
<p class="description">
|
154 |
+
<input type="hidden" name="interface[playlist_advance]" value="false"/>
|
155 |
+
<input type="checkbox" name="interface[playlist_advance]" id="interface[playlist_advance]" value="true" />
|
156 |
+
</p>
|
157 |
+
</td>
|
158 |
+
</tr>
|
159 |
+
<tr>
|
160 |
+
<td class="first"><label for="interface[playlist]">Playlist Style:</label></td>
|
161 |
+
<td>
|
162 |
+
<p class="description">
|
163 |
+
<input type="hidden" name="interface[playlist]" value="false"/>
|
164 |
+
<input type="checkbox" name="interface[playlist]" id="interface[playlist]" value="true" />
|
165 |
+
</p>
|
166 |
+
</td>
|
167 |
+
</tr>
|
168 |
+
<tr>
|
169 |
+
<td class="first"><label for="interface[playlist_captions]">Playlist Captions:</label></td>
|
170 |
+
<td>
|
171 |
+
<p class="description">
|
172 |
+
<input type="hidden" name="interface[playlist_captions]" value="false"/>
|
173 |
+
<input type="checkbox" name="interface[playlist_captions]" id="interface[playlist_captions]" value="true" />
|
174 |
+
</p>
|
175 |
+
</td>
|
176 |
+
</tr>
|
177 |
+
<tr>
|
178 |
+
<td class="first"><label for="interface[share]">Sharing Buttons:</label></td>
|
179 |
+
<td>
|
180 |
+
<p class="description">
|
181 |
+
<input type="hidden" name="interface[share]" value="false"/>
|
182 |
+
<input type="checkbox" name="interface[share]" id="interface[share]" value="true" />
|
183 |
+
</p>
|
184 |
+
</td>
|
185 |
+
</tr>
|
186 |
+
<tr>
|
187 |
+
<td class="first"><label for="interface[speed]">Speed Buttons:</label></td>
|
188 |
+
<td>
|
189 |
+
<p class="description">
|
190 |
+
<input type="hidden" name="interface[speed]" value="false"/>
|
191 |
+
<input type="checkbox" name="interface[speed]" id="interface[speed]" value="true" />
|
192 |
+
</p>
|
193 |
+
</td>
|
194 |
+
</tr>
|
195 |
+
<tr>
|
196 |
+
<td class="first"><label for="interface[splash_text]">Splash Text:</label></td>
|
197 |
+
<td>
|
198 |
+
<p class="description">
|
199 |
+
<input type="hidden" name="interface[splash_text]" value="false"/>
|
200 |
+
<input type="checkbox" name="interface[splash_text]" id="interface[splash_text]" value="true" />
|
201 |
+
</p>
|
202 |
+
</td>
|
203 |
+
</tr>
|
204 |
+
<tr>
|
205 |
+
<td class="first"><label for="interface[subtitles]">Subtitles:</label></td>
|
206 |
+
<td>
|
207 |
+
<p class="description">
|
208 |
+
<input type="hidden" name="interface[subtitles]" value="false"/>
|
209 |
+
<input type="checkbox" name="interface[subtitles]" id="interface[subtitles]" value="true" />
|
210 |
+
</p>
|
211 |
+
</td>
|
212 |
+
</tr>
|
213 |
+
<tr>
|
214 |
+
<td class="first"><label for="interface[sticky]">Sticky:</label></td>
|
215 |
+
<td>
|
216 |
+
<p class="description">
|
217 |
+
<input type="hidden" name="interface[sticky]" value="false"/>
|
218 |
+
<input type="checkbox" name="interface[sticky]" id="interface[sticky]" value="true" />
|
219 |
+
</p>
|
220 |
+
</td>
|
221 |
+
</tr>
|
222 |
+
<tr>
|
223 |
+
<td class="first"><label for="interface[end_actions]">Video Actions:</label></td>
|
224 |
+
<td>
|
225 |
+
<p class="description">
|
226 |
+
<input type="hidden" name="interface[end_actions]" value="false"/>
|
227 |
+
<input type="checkbox" name="interface[end_actions]" id="interface[end_actions]" value="true" />
|
228 |
+
Enables end of playlist actions like Loop, Redirect, Show popup and Show splash screen </p>
|
229 |
+
</td>
|
230 |
+
</tr>
|
231 |
+
|
232 |
+
<tr>
|
233 |
+
<td class="first"><label for="interface[lightbox]">Enable video lightbox:</label></td>
|
234 |
+
<td>
|
235 |
+
<p class="description">
|
236 |
+
<input type="hidden" name="interface[lightbox]" value="false"/>
|
237 |
+
<input type="checkbox" name="interface[lightbox]" id="interface[lightbox]" value="true" />
|
238 |
+
You can also put in <code><a href="http://path.to.your/video.mp4" class="colorbox">Your link title</a></code> for a quick lightboxed video. </p>
|
239 |
+
</td>
|
240 |
+
</tr>
|
241 |
+
|
242 |
+
<tr>
|
243 |
+
<td class="first"><label for="interface[shortcode_editor_old]">Enable old interface:</label></td>
|
244 |
+
<td>
|
245 |
+
<p class="description">
|
246 |
+
<input type="hidden" name="interface[shortcode_editor_old]" value="false"/>
|
247 |
+
<input type="checkbox" name="interface[shortcode_editor_old]" id="interface[shortcode_editor_old]" value="true" />
|
248 |
+
Not recommended </p>
|
249 |
+
</td>
|
250 |
+
</tr>
|
251 |
+
|
252 |
+
<tr>
|
253 |
+
<td colspan="4">
|
254 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
255 |
+
</td>
|
256 |
+
</tr>
|
257 |
+
</table>
|
258 |
+
</div>
|
259 |
+
</div>
|
260 |
+
<div id="fv_flowplayer_default_options" class="postbox " >
|
261 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Sitewide FV Player Defaults</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Sitewide FV Player Defaults</span></h2>
|
262 |
+
<div class="inside">
|
263 |
+
<style>
|
264 |
+
p.description { font-style: normal; }
|
265 |
+
</style>
|
266 |
+
<table class="form-table2">
|
267 |
+
|
268 |
+
<tr>
|
269 |
+
<td class="first"><label for="autoplay">Autoplay:</label></td>
|
270 |
+
<td>
|
271 |
+
<p class="description">
|
272 |
+
<input type="hidden" name="autoplay" value="false"/>
|
273 |
+
<input type="checkbox" name="autoplay" id="autoplay" value="true" />
|
274 |
+
We make sure only one video per page autoplays. Note that mobile devices don't support autoplay. </p>
|
275 |
+
</td>
|
276 |
+
</tr>
|
277 |
+
<tr>
|
278 |
+
<td class="first"><label for="auto_buffering">Auto Buffering:</label></td>
|
279 |
+
<td>
|
280 |
+
<p class="description">
|
281 |
+
<input type="hidden" name="auto_buffering" value="false"/>
|
282 |
+
<input type="checkbox" name="auto_buffering" id="auto_buffering" value="true" />
|
283 |
+
Works for first 2 videos on the page only, to preserve your bandwidth. </p>
|
284 |
+
</td>
|
285 |
+
</tr>
|
286 |
+
|
287 |
+
<tr>
|
288 |
+
<td><label for="width">Default Video Size:</label></td>
|
289 |
+
<td>
|
290 |
+
<p class="description">
|
291 |
+
<label for="width">Width:</label> <input type="text" class="small" name="width" id="width" value="640" />
|
292 |
+
<label for="height">Height:</label> <input type="text" class="small" name="height" id="height" value="360" />
|
293 |
+
Enter values in pixels or 100%. </p>
|
294 |
+
</td>
|
295 |
+
</tr>
|
296 |
+
<tr>
|
297 |
+
<td><label for="volume">Default Volume:</label></td>
|
298 |
+
<td>
|
299 |
+
<p class="description">
|
300 |
+
<input id="volume" name="volume" type="range" min="0" max="1" step="0.1" value="0.7" class="medium" />
|
301 |
+
</p>
|
302 |
+
</td>
|
303 |
+
</tr>
|
304 |
+
|
305 |
+
<tr>
|
306 |
+
<td class="first"><label for="disable_videochecker">Disable Admin Video Checker:</label></td>
|
307 |
+
<td>
|
308 |
+
<p class="description">
|
309 |
+
<input type="hidden" name="disable_videochecker" value="false"/>
|
310 |
+
<input type="checkbox" name="disable_videochecker" id="disable_videochecker" value="true" />
|
311 |
+
Checks your video encoding when you open a post with video as admin. Notifies you about possible playback issues. </p>
|
312 |
+
</td>
|
313 |
+
</tr>
|
314 |
+
<tr>
|
315 |
+
<td class="first"><label for="disableembedding">Disable Embed Button:</label></td>
|
316 |
+
<td>
|
317 |
+
<p class="description">
|
318 |
+
<input type="hidden" name="disableembedding" value="false"/>
|
319 |
+
<input type="checkbox" name="disableembedding" id="disableembedding" value="true" />
|
320 |
+
Removes embed button from top bar. </p>
|
321 |
+
</td>
|
322 |
+
</tr>
|
323 |
+
<tr>
|
324 |
+
<td class="first"><label for="playlist_advance">Disable Playlist Autoadvance:</label></td>
|
325 |
+
<td>
|
326 |
+
<p class="description">
|
327 |
+
<input type="hidden" name="playlist_advance" value="false"/>
|
328 |
+
<input type="checkbox" name="playlist_advance" id="playlist_advance" value="true" />
|
329 |
+
Playlist won't play the next video automatically. </p>
|
330 |
+
</td>
|
331 |
+
</tr>
|
332 |
+
<tr>
|
333 |
+
<td class="first"><label for="disablesharing">Disable Sharing:</label></td>
|
334 |
+
<td>
|
335 |
+
<p class="description">
|
336 |
+
<input type="hidden" name="disablesharing" value="false"/>
|
337 |
+
<input type="checkbox" name="disablesharing" id="disablesharing" value="true" />
|
338 |
+
Removes sharing buttons from top bar. </p>
|
339 |
+
</td>
|
340 |
+
</tr>
|
341 |
+
<tr>
|
342 |
+
<td class="first"><label for="disable_video_hash_links">Disable Video Links:</label></td>
|
343 |
+
<td>
|
344 |
+
<p class="description">
|
345 |
+
<input type="hidden" name="disable_video_hash_links" value="false"/>
|
346 |
+
<input type="checkbox" name="disable_video_hash_links" id="disable_video_hash_links" value="true" />
|
347 |
+
Removes the "Link" item to the top bar. <span class="more">Clicking the video Link gives your visitors a link to the exact place in the video they are watching. If the post access is restricted, it won't make the video open to public.</span> <a href="#" class="show-more">(…)</a>
|
348 |
+
</p>
|
349 |
+
</td>
|
350 |
+
</tr>
|
351 |
+
|
352 |
+
<tr>
|
353 |
+
<td><label for="rtmp">Flash Streaming Server:</label></td>
|
354 |
+
<td>
|
355 |
+
<p class="description">
|
356 |
+
<input type="text" name="rtmp" id="rtmp" value="" placeholder="Enter your default RTMP streaming server (Amazon CloudFront domain)." />
|
357 |
+
</p>
|
358 |
+
</td>
|
359 |
+
</tr>
|
360 |
+
|
361 |
+
<tr>
|
362 |
+
<td class="first"><label for="allowfullscreen">Fullscreen Button:</label></td>
|
363 |
+
<td>
|
364 |
+
<p class="description">
|
365 |
+
<input type="hidden" name="allowfullscreen" value="false"/>
|
366 |
+
<input type="checkbox" name="allowfullscreen" id="allowfullscreen" value="true" checked="checked" />
|
367 |
+
Adds fullscreen button to player top bar. </p>
|
368 |
+
</td>
|
369 |
+
</tr>
|
370 |
+
|
371 |
+
<tr>
|
372 |
+
<td><label for="googleanalytics">Google Analytics ID:</label></td>
|
373 |
+
<td>
|
374 |
+
<p class="description">
|
375 |
+
<input type="text" name="googleanalytics" id="googleanalytics" value="" placeholder="Will be automatically loaded when playing a video." />
|
376 |
+
</p>
|
377 |
+
</td>
|
378 |
+
</tr>
|
379 |
+
<tr>
|
380 |
+
<td><label for="logo">Logo:</label></td>
|
381 |
+
<td>
|
382 |
+
<input type="text" name="logo" id="logo" value="" class="large" placeholder="You need to have a FV Flowplayer license to use it" />
|
383 |
+
|
384 |
+
<input id="upload_image_button" class="upload_image_button button no-margin small" type="button" value="Upload Image" alt="Select Logo" />
|
385 |
+
|
386 |
+
<select name="logoPosition" class="small">
|
387 |
+
<option value="bottom-left">Position</option>
|
388 |
+
<option selected value="bottom-left">Bottom-left</option>
|
389 |
+
<option value="bottom-right">Bottom-right</option>
|
390 |
+
<option value="top-left">Top-left</option>
|
391 |
+
<option value="top-right">Top-right</option>
|
392 |
+
</select>
|
393 |
+
</td>
|
394 |
+
</tr>
|
395 |
+
|
396 |
+
<tr>
|
397 |
+
<td class="first"><label for="ui_play_button">Play Button:</label></td>
|
398 |
+
<td>
|
399 |
+
<p class="description">
|
400 |
+
<input type="hidden" name="ui_play_button" value="false"/>
|
401 |
+
<input type="checkbox" name="ui_play_button" id="ui_play_button" value="true" checked="checked" />
|
402 |
+
Adds play button to player controlbar. </p>
|
403 |
+
</td>
|
404 |
+
</tr>
|
405 |
+
|
406 |
+
<tr>
|
407 |
+
<td><label for="liststyle">Playlist style:</label></td>
|
408 |
+
<td colspan="3">
|
409 |
+
<p class="description">
|
410 |
+
<select id="liststyle" name="liststyle">
|
411 |
+
<option value="horizontal" selected="selected" >Horizontal</option>
|
412 |
+
<option value="tabs" >Tabs</option>
|
413 |
+
<option value="prevnext" >Prev/Next</option>
|
414 |
+
<option value="vertical" >Vertical</option>
|
415 |
+
<option value="slider" >Slider</option>
|
416 |
+
</select>
|
417 |
+
Enter your default playlist style here </p>
|
418 |
+
</td>
|
419 |
+
</tr>
|
420 |
+
|
421 |
+
<tr>
|
422 |
+
<td class="first"><label for="popupbox">Popup Box:</label></td>
|
423 |
+
<td>
|
424 |
+
<p class="description">
|
425 |
+
<input type="hidden" name="popupbox" value="false"/>
|
426 |
+
<input type="checkbox" name="popupbox" id="popupbox" value="true" />
|
427 |
+
Shows a generic "Would you like to replay the video?" message at the end of each video. </p>
|
428 |
+
</td>
|
429 |
+
</tr>
|
430 |
+
|
431 |
+
<tr>
|
432 |
+
<td><label for="sharing_text">Sharing Text:</label></td>
|
433 |
+
<td>
|
434 |
+
<p class="description">
|
435 |
+
<input type="text" name="sharing_email_text" id="sharing_email_text" value="Check out the amazing video here" placeholder="Check out the amazing video here" />
|
436 |
+
</p>
|
437 |
+
</td>
|
438 |
+
</tr>
|
439 |
+
|
440 |
+
<tr>
|
441 |
+
<td class="first"><label for="ui_speed">Speed Buttons:</label></td>
|
442 |
+
<td>
|
443 |
+
<p class="description">
|
444 |
+
<input type="hidden" name="ui_speed" value="false"/>
|
445 |
+
<input type="checkbox" name="ui_speed" id="ui_speed" value="true" />
|
446 |
+
Speed buttons control playback speed and only work in HTML5 compatible browsers. </p>
|
447 |
+
</td>
|
448 |
+
</tr>
|
449 |
+
|
450 |
+
<tr>
|
451 |
+
<td><label for="ui_speed_increment">Speed Step:</label></td>
|
452 |
+
<td colspan="3">
|
453 |
+
<p class="description">
|
454 |
+
<select id="ui_speed_increment" name="ui_speed_increment">
|
455 |
+
<option value="0.1" >0.1</option>
|
456 |
+
<option value="0.25" selected="selected" >0.25</option>
|
457 |
+
<option value="0.5" >0.5</option>
|
458 |
+
</select>
|
459 |
+
Speed buttons will increase or decrease the speed in steps of selected value </p>
|
460 |
+
</td>
|
461 |
+
</tr>
|
462 |
+
<tr>
|
463 |
+
<td><label for="splash">Splash Image:</label></td>
|
464 |
+
<td>
|
465 |
+
<input type="text" name="splash" id="splash" value="" class="large" placeholder="Default which will be used for any player without its own splash image." />
|
466 |
+
<input id="upload_image_button" class="upload_image_button button no-margin small" type="button" value="Upload Image" alt="Select default Splash Screen" /></td>
|
467 |
+
</tr>
|
468 |
+
|
469 |
+
<tr>
|
470 |
+
<td class="first"><label for="subtitleOn">Subtitles On By Default:</label></td>
|
471 |
+
<td>
|
472 |
+
<p class="description">
|
473 |
+
<input type="hidden" name="subtitleOn" value="false"/>
|
474 |
+
<input type="checkbox" name="subtitleOn" id="subtitleOn" value="true" />
|
475 |
+
Normally you have to hit a button in controlbar to turn on subtitles. </p>
|
476 |
+
</td>
|
477 |
+
</tr>
|
478 |
+
|
479 |
+
<tr>
|
480 |
+
<td style="width: 250px"><label for="lightbox_images">Use video lightbox for images as well:</label></td>
|
481 |
+
<td>
|
482 |
+
<p class="description">
|
483 |
+
<input type="hidden" value="false" name="lightbox_images" />
|
484 |
+
<input type="checkbox" value="true" name="lightbox_images" id="lightbox_images" />
|
485 |
+
Will group images as well as videos into the same lightbox gallery. Turn <strong>off</strong> your lightbox plugin when using this. <span class="more">Also works with WordPress <code>[gallery]</code> galleries - these are automatically switched to link to image URLs rather than the attachment pages.</span> <a href="#" class="show-more">(…)</a>
|
486 |
+
</p>
|
487 |
+
</td>
|
488 |
+
</tr>
|
489 |
+
<tr id="lightbox-wp-galleries">
|
490 |
+
<td style="width: 250px"><label for="lightbox_improve_galleries">Use video lightbox for WP Galleries:</label></td>
|
491 |
+
<td>
|
492 |
+
<p class="description">
|
493 |
+
<input type="hidden" value="false" name="lightbox_improve_galleries" />
|
494 |
+
<input type="checkbox" value="true" name="lightbox_improve_galleries" id="lightbox_improve_galleries" />
|
495 |
+
Your gallery items will link to image files directly to allow this. </p>
|
496 |
+
</td>
|
497 |
+
</tr>
|
498 |
+
<script>
|
499 |
+
jQuery(document).ready(function(){
|
500 |
+
jQuery('[name="pro[interface][lightbox]"]').parents('td').replaceWith('<td><p>Setting <a href="#interface[live]">moved</a></p></td>');
|
501 |
+
jQuery('[name="pro[lightbox_images]"]').parents('td').replaceWith('<td><p>Setting <a href="#subtitleOn">moved</a></p></td>');
|
502 |
+
var lightbox_images = jQuery('#lightbox_images');
|
503 |
+
if(lightbox_images.attr('checked')){
|
504 |
+
jQuery('#lightbox-wp-galleries').show();
|
505 |
+
}else{
|
506 |
+
jQuery('#lightbox-wp-galleries').hide();
|
507 |
+
}
|
508 |
+
lightbox_images.on('click',function(){
|
509 |
+
if(jQuery(this).attr('checked')){
|
510 |
+
jQuery('#lightbox-wp-galleries').show();
|
511 |
+
}else{
|
512 |
+
jQuery('#lightbox-wp-galleries').hide();
|
513 |
+
}
|
514 |
+
})
|
515 |
+
})
|
516 |
+
</script>
|
517 |
+
<tr>
|
518 |
+
<td class="first"><label for="video_position_save_enable">Remember video position:</label></td>
|
519 |
+
<td>
|
520 |
+
<p class="description">
|
521 |
+
<input type="hidden" name="video_position_save_enable" value="false"/>
|
522 |
+
<input type="checkbox" name="video_position_save_enable" id="video_position_save_enable" value="true" />
|
523 |
+
Stores the last video play position for users, so they can continue watching from where they left. <span class="more">It stored in usermeta for logged in users and in a localStorage or cookie for guest users.</span> <a href="#" class="show-more">(…)</a>
|
524 |
+
</p>
|
525 |
+
</td>
|
526 |
+
</tr>
|
527 |
+
</table>
|
528 |
+
<small class="alignright">
|
529 |
+
Missing settings? Check <a class="fv-settings-anchor" href="#fv_flowplayer_integrations">Integrations/Compatbility</a> box below. </small>
|
530 |
+
<table class="form-table2">
|
531 |
+
<tr>
|
532 |
+
<td colspan="4">
|
533 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
534 |
+
</td>
|
535 |
+
</tr>
|
536 |
+
</table>
|
537 |
+
<script>
|
538 |
+
jQuery(document).ready(function($) {
|
539 |
+
var fv_flowplayer_uploader;
|
540 |
+
var fv_flowplayer_uploader_button;
|
541 |
+
|
542 |
+
$(document).on( 'click', '.upload_image_button', function(e) {
|
543 |
+
e.preventDefault();
|
544 |
+
|
545 |
+
fv_flowplayer_uploader_button = jQuery(this);
|
546 |
+
jQuery('.fv_flowplayer_target').removeClass('fv_flowplayer_target' );
|
547 |
+
fv_flowplayer_uploader_button.parents('tr').find('input[type=text]').addClass('fv_flowplayer_target' );
|
548 |
+
|
549 |
+
//If the uploader object has already been created, reopen the dialog
|
550 |
+
if (fv_flowplayer_uploader) {
|
551 |
+
fv_flowplayer_uploader.open();
|
552 |
+
return;
|
553 |
+
}
|
554 |
+
|
555 |
+
//Extend the wp.media object
|
556 |
+
fv_flowplayer_uploader = wp.media.frames.file_frame = wp.media({
|
557 |
+
title: 'Pick the image',
|
558 |
+
button: {
|
559 |
+
text: 'Choose'
|
560 |
+
},
|
561 |
+
multiple: false
|
562 |
+
});
|
563 |
+
|
564 |
+
fv_flowplayer_uploader.on('open', function() {
|
565 |
+
jQuery('.media-frame-title h1').text(fv_flowplayer_uploader_button.attr('alt'));
|
566 |
+
});
|
567 |
+
|
568 |
+
//When a file is selected, grab the URL and set it as the text field's value
|
569 |
+
fv_flowplayer_uploader.on('select', function() {
|
570 |
+
attachment = fv_flowplayer_uploader.state().get('selection').first().toJSON();
|
571 |
+
|
572 |
+
$('.fv_flowplayer_target').val(attachment.url);
|
573 |
+
$('.fv_flowplayer_target').removeClass('fv_flowplayer_target' );
|
574 |
+
|
575 |
+
/*if( attachment.type == 'video' ) {
|
576 |
+
if( typeof(attachment.width) != "undefined" && attachment.width > 0 ) {
|
577 |
+
$('#fv_wp_flowplayer_field_width').val(attachment.width);
|
578 |
+
}
|
579 |
+
if( typeof(attachment.height) != "undefined" && attachment.height > 0 ) {
|
580 |
+
$('#fv_wp_flowplayer_field_height').val(attachment.height);
|
581 |
+
}
|
582 |
+
if( typeof(attachment.fileLength) != "undefined" ) {
|
583 |
+
$('#fv_wp_flowplayer_file_info').show();
|
584 |
+
$('#fv_wp_flowplayer_file_duration').html(attachment.fileLength);
|
585 |
+
}
|
586 |
+
if( typeof(attachment.filesizeHumanReadable) != "undefined" ) {
|
587 |
+
$('#fv_wp_flowplayer_file_info').show();
|
588 |
+
$('#fv_wp_flowplayer_file_size').html(attachment.filesizeHumanReadable);
|
589 |
+
}
|
590 |
+
|
591 |
+
} else if( attachment.type == 'image' && typeof(fv_flowplayer_set_post_thumbnail_id) != "undefined" ) {
|
592 |
+
if( jQuery('#remove-post-thumbnail').length > 0 ){
|
593 |
+
return;
|
594 |
+
}
|
595 |
+
jQuery.post(ajaxurl, {
|
596 |
+
action:"set-post-thumbnail",
|
597 |
+
post_id: fv_flowplayer_set_post_thumbnail_id,
|
598 |
+
thumbnail_id: attachment.id,
|
599 |
+
_ajax_nonce: fv_flowplayer_set_post_thumbnail_nonce,
|
600 |
+
cookie: encodeURIComponent(document.cookie)
|
601 |
+
}, function(str){
|
602 |
+
var win = window.dialogArguments || opener || parent || top;
|
603 |
+
if ( str == '0' ) {
|
604 |
+
alert( setPostThumbnailL10n.error );
|
605 |
+
} else {
|
606 |
+
jQuery('#postimagediv .inside').html(str);
|
607 |
+
jQuery('#postimagediv .inside #plupload-upload-ui').hide();
|
608 |
+
}
|
609 |
+
} );
|
610 |
+
|
611 |
+
}*/
|
612 |
+
|
613 |
+
});
|
614 |
+
|
615 |
+
//Open the uploader dialog
|
616 |
+
fv_flowplayer_uploader.open();
|
617 |
+
|
618 |
+
});
|
619 |
+
|
620 |
+
});
|
621 |
+
</script>
|
622 |
+
<div class="clear"></div>
|
623 |
+
</div>
|
624 |
+
</div>
|
625 |
+
<div id="fv_flowplayer_integrations" class="postbox " >
|
626 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Integrations/Compatibility</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Integrations/Compatibility</span></h2>
|
627 |
+
<div class="inside">
|
628 |
+
<p>Following options are suitable for web developers and programmers.</p>
|
629 |
+
<table class="form-table2">
|
630 |
+
|
631 |
+
<tr>
|
632 |
+
<td class="first"><label for="fixed_size">Always use fixed size player:</label></td>
|
633 |
+
<td>
|
634 |
+
<p class="description">
|
635 |
+
<input type="hidden" name="fixed_size" value="false"/>
|
636 |
+
<input type="checkbox" name="fixed_size" id="fixed_size" value="true" />
|
637 |
+
Enable to force video size at cost of loosing the video responsiveness. </p>
|
638 |
+
</td>
|
639 |
+
</tr>
|
640 |
+
<tr>
|
641 |
+
<td class="first"><label for="css_disable">Disable saving skin CSS to a static file:</label></td>
|
642 |
+
<td>
|
643 |
+
<p class="description">
|
644 |
+
<input type="hidden" name="css_disable" value="false"/>
|
645 |
+
<input type="checkbox" name="css_disable" id="css_disable" value="true" />
|
646 |
+
Normally the player CSS configuration is stored in wp-content/fv-player-custom/style-{blog_id}.css. <span class="more">We do this to avoid a big style tag in your site <head>. Don't edit this file though, as it will be overwritten by plugin update or saving its options!</span> <a href="#" class="show-more">(…)</a>
|
647 |
+
</p>
|
648 |
+
</td>
|
649 |
+
</tr>
|
650 |
+
<tr>
|
651 |
+
<td class="first"><label for="hlsjs">Enable HLS.js:</label></td>
|
652 |
+
<td>
|
653 |
+
<p class="description">
|
654 |
+
<input type="hidden" name="hlsjs" value="false"/>
|
655 |
+
<input type="checkbox" name="hlsjs" id="hlsjs" value="true" checked="checked" />
|
656 |
+
Allows HLS playback in all modern browsers. <span class="more">HLS normally plays only on iOS, Mac Safari and new Android versions. FV Player increases the compatibility by using Flash engine for HLS. With this option you can go even further and modern browsers supporting MediaSource will play HLS even without Flash. Make sure you setup the required CORS headers.</span> <a href="#" class="show-more">(…)</a>
|
657 |
+
</p>
|
658 |
+
</td>
|
659 |
+
</tr>
|
660 |
+
|
661 |
+
<tr>
|
662 |
+
<td><label for="css_disable">Enable profile videos:</label></td>
|
663 |
+
<td>
|
664 |
+
<div class="description">
|
665 |
+
<input type="hidden" name="profile_videos_enable_bio" value="false" />
|
666 |
+
<input type="checkbox" name="profile_videos_enable_bio" id="profile_videos_enable_bio" value="true" />
|
667 |
+
Check your site carefully after enabling. Videos attached to the user profile will be showing as a part of the user bio. <a href="#" class="show-more">(…)</a>
|
668 |
+
<div class="more">
|
669 |
+
<p>This feature is designed for YouTube and Vimeo videos and works best for our licensed users who get these videos playing without YouTube or Vimeo branding.</p>
|
670 |
+
<p>Some themes show author bio on the author post archive automatically (Genesis framework and others). Or you can also just put this code into your theme archive.php template, right before <code>while ( have_posts() )</code> is called:</p>
|
671 |
+
<blockquote>
|
672 |
+
<pre>
|
673 |
+
<?php if ( is_author() && get_the_author_meta( 'description' ) ) : ?>
|
674 |
+
<div class="author-info">
|
675 |
+
<div class="author-avatar">
|
676 |
+
<?php echo get_avatar( get_the_author_meta( 'user_email' ) ); ?>
|
677 |
+
</div>
|
678 |
+
|
679 |
+
<div class="author-description">
|
680 |
+
<?php the_author_meta( 'description' ); ?>
|
681 |
+
</div>
|
682 |
+
</div>
|
683 |
+
<?php endif; ?>
|
684 |
+
</pre>
|
685 |
+
</blockquote>
|
686 |
+
<p>We will be adding integration for it for popular user profile plugins.</p>
|
687 |
+
|
688 |
+
</div>
|
689 |
+
</div>
|
690 |
+
</td>
|
691 |
+
</tr>
|
692 |
+
|
693 |
+
<tr>
|
694 |
+
<td class="first"><label for="integrations[wp_core_video]">Handle WordPress <code><small>[video]</small></code> shortcodes:</label></td>
|
695 |
+
<td>
|
696 |
+
<p class="description">
|
697 |
+
<input type="hidden" name="integrations[wp_core_video]" value="false"/>
|
698 |
+
<input type="checkbox" name="integrations[wp_core_video]" id="integrations[wp_core_video]" value="true" />
|
699 |
+
...and also the YouTube links </p>
|
700 |
+
</td>
|
701 |
+
</tr>
|
702 |
+
<tr>
|
703 |
+
<td class="first"><label for="js-everywhere">Load FV Flowplayer JS everywhere:</label></td>
|
704 |
+
<td>
|
705 |
+
<p class="description">
|
706 |
+
<input type="hidden" name="js-everywhere" value="false"/>
|
707 |
+
<input type="checkbox" name="js-everywhere" id="js-everywhere" value="true" />
|
708 |
+
If you use some special JavaScript integration you might prefer this option. <span class="more">Otherwise our JavaScript only loads if the shortcode is found in any of the posts being currently displayed.</span> <a href="#" class="show-more">(…)</a>
|
709 |
+
</p>
|
710 |
+
</td>
|
711 |
+
</tr>
|
712 |
+
<tr>
|
713 |
+
<td class="first"><label for="parse_comments">Parse Vimeo and YouTube links:</label></td>
|
714 |
+
<td>
|
715 |
+
<p class="description">
|
716 |
+
<input type="hidden" name="parse_comments" value="false"/>
|
717 |
+
<input type="checkbox" name="parse_comments" id="parse_comments" value="true" />
|
718 |
+
Affects comments, bbPress and BuddyPress. These links will be displayed as videos. <span class="more">This option makes most sense together with FV Player Pro as it embeds these videos using FV Player. Enables use of shortcodes in comments and bbPress.</span> <a href="#" class="show-more">(…)</a>
|
719 |
+
</p>
|
720 |
+
</td>
|
721 |
+
</tr>
|
722 |
+
<tr>
|
723 |
+
<td class="first"><label for="postthumbnail">Post Thumbnail:</label></td>
|
724 |
+
<td>
|
725 |
+
<p class="description">
|
726 |
+
<input type="hidden" name="postthumbnail" value="false"/>
|
727 |
+
<input type="checkbox" name="postthumbnail" id="postthumbnail" value="true" />
|
728 |
+
Setting a video splash screen from the media library will automatically make it the splash image if there is none. </p>
|
729 |
+
</td>
|
730 |
+
</tr>
|
731 |
+
<tr>
|
732 |
+
<td class="first"><label for="rtmp-live-buffer">RTMP bufferTime tweak:</label></td>
|
733 |
+
<td>
|
734 |
+
<p class="description">
|
735 |
+
<input type="hidden" name="rtmp-live-buffer" value="false"/>
|
736 |
+
<input type="checkbox" name="rtmp-live-buffer" id="rtmp-live-buffer" value="true" />
|
737 |
+
Use if your live streams are not smooth. <span class="more">Adobe <a href="http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#bufferTime">recommends</a> to set bufferTime to 0 for live streams, but if your stream is not smooth, you can use this setting.</span> <a href="#" class="show-more">(…)</a>
|
738 |
+
</p>
|
739 |
+
</td>
|
740 |
+
</tr>
|
741 |
+
|
742 |
+
<tr>
|
743 |
+
<td class="first"><label for="db_duration">Scan video length:</label></td>
|
744 |
+
<td>
|
745 |
+
<p class="description">
|
746 |
+
<input type="hidden" name="db_duration" value="false" />
|
747 |
+
<input type="checkbox" name="db_duration" id="db_duration" value="true" />
|
748 |
+
Turn off if you experience issues when saving posts! <span class="more">Turn on to enable video duration scanning. Currently posts in queue. </span> <a href="#" class="show-more">(…)</a>
|
749 |
+
</p>
|
750 |
+
</td>
|
751 |
+
</tr>
|
752 |
+
<!--<tr>
|
753 |
+
<td style="width: 350px"><label for="optimizepress2">Handle OptimizePress 2 videos (<abbr title="Following attributes are not currently supported: margin, border">?</abbr>):</label></td>
|
754 |
+
<td>
|
755 |
+
<input type="hidden" name="integrations[optimizepress2]" value="false" />
|
756 |
+
<input type="checkbox" name="integrations[optimizepress2]" id="optimizepress2" value="true" />
|
757 |
+
</td>
|
758 |
+
</tr>-->
|
759 |
+
|
760 |
+
<tr>
|
761 |
+
<td class="first"><label for="integrations[embed_iframe]">Use iframe embedding:</label></td>
|
762 |
+
<td>
|
763 |
+
<p class="description">
|
764 |
+
<input type="hidden" name="integrations[embed_iframe]" value="false"/>
|
765 |
+
<input type="checkbox" name="integrations[embed_iframe]" id="integrations[embed_iframe]" value="true" />
|
766 |
+
Beta version! New kind of embedding which supports all the features in embedded player. </p>
|
767 |
+
</td>
|
768 |
+
</tr>
|
769 |
+
<tr>
|
770 |
+
<td class="first"><label for="integrations[featured_img]">Add featured image automatically:</label></td>
|
771 |
+
<td>
|
772 |
+
<p class="description">
|
773 |
+
<input type="hidden" name="integrations[featured_img]" value="false"/>
|
774 |
+
<input type="checkbox" name="integrations[featured_img]" id="integrations[featured_img]" value="true" />
|
775 |
+
If the featured image is not set, splash image of the first player will be used. </p>
|
776 |
+
</td>
|
777 |
+
</tr>
|
778 |
+
|
779 |
+
<tr>
|
780 |
+
<td><label for="facebook_sharing">Facebook Video Sharing:</label></td>
|
781 |
+
<td>
|
782 |
+
<p class="description">
|
783 |
+
<input type="hidden" name="integrations[facebook_sharing]" value="false" />
|
784 |
+
<input type="checkbox" name="integrations[facebook_sharing]" id="facebook_sharing" value="true" />
|
785 |
+
When sharing your post to Facebook the first MP4 video will be shared directly rather than the post excerpt. <span class="more"><strong>Requirements</strong>: video has to be on https:// and splash screen has to be present. Videos with download protection are automatically excluded.</span> <a href="#" class="show-more">(…)</a>
|
786 |
+
</p>
|
787 |
+
</td>
|
788 |
+
</tr>
|
789 |
+
<tr>
|
790 |
+
<td colspan="4">
|
791 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
792 |
+
</td>
|
793 |
+
</tr>
|
794 |
+
</table>
|
795 |
+
</div>
|
796 |
+
</div>
|
797 |
+
<div id="fv_flowplayer_mobile" class="postbox " >
|
798 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Mobile Settings</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Mobile Settings</span></h2>
|
799 |
+
<div class="inside">
|
800 |
+
|
801 |
+
<table class="form-table2">
|
802 |
+
<tr>
|
803 |
+
<td class="first"><label for="mobile_native_fullscreen">Use native fullscreen on mobile:</label></td>
|
804 |
+
<td>
|
805 |
+
<p class="description">
|
806 |
+
<input type="hidden" name="mobile_native_fullscreen" value="false"/>
|
807 |
+
<input type="checkbox" name="mobile_native_fullscreen" id="mobile_native_fullscreen" value="true" />
|
808 |
+
Stops popups, ads or subtitles from working, but provides faster interface. We set this for Android < 4.4 and iOS < 7 automatically. </p>
|
809 |
+
</td>
|
810 |
+
</tr>
|
811 |
+
<tr>
|
812 |
+
<td class="first"><label for="mobile_force_fullscreen">Force fullscreen on mobile (beta):</label></td>
|
813 |
+
<td>
|
814 |
+
<p class="description">
|
815 |
+
<input type="hidden" name="mobile_force_fullscreen" value="false"/>
|
816 |
+
<input type="checkbox" name="mobile_force_fullscreen" id="mobile_force_fullscreen" value="true" />
|
817 |
+
Video playback will start in fullscreen. iPhone with iOS < 10 always forces fullscreen for video playback. </p>
|
818 |
+
</td>
|
819 |
+
</tr>
|
820 |
+
<tr>
|
821 |
+
<td colspan="4">
|
822 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
823 |
+
</td>
|
824 |
+
</tr>
|
825 |
+
</table>
|
826 |
+
</div>
|
827 |
+
</div>
|
828 |
+
<div id="fv_flowplayer_seo" class="postbox " >
|
829 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Video SEO</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Video SEO</span></h2>
|
830 |
+
<div class="inside">
|
831 |
+
<table class="form-table2">
|
832 |
+
<tr>
|
833 |
+
<td class="first"><label for="integrations[schema_org]">Use Schema.org markup:</label></td>
|
834 |
+
<td>
|
835 |
+
<p class="description">
|
836 |
+
<input type="hidden" name="integrations[schema_org]" value="false"/>
|
837 |
+
<input type="checkbox" name="integrations[schema_org]" id="integrations[schema_org]" value="true" />
|
838 |
+
Adds the video meta data information for search engines. </p>
|
839 |
+
</td>
|
840 |
+
</tr>
|
841 |
+
<tr>
|
842 |
+
<td class="first"><label for="video_sitemap">Use XML Video Sitemap:</label></td>
|
843 |
+
<td>
|
844 |
+
<p class="description">
|
845 |
+
<input type="hidden" name="video_sitemap" value="false"/>
|
846 |
+
<input type="checkbox" name="video_sitemap" id="video_sitemap" value="true" />
|
847 |
+
Creates <code>http://example.org/video-sitemap.xml</code> which you can submit via Google Webmaster Tools. <span class="more">As feeds tend to be cached by web browser make sure you clear your browser cache if you are doing some testing.</span> <a href="#" class="show-more">(…)</a>
|
848 |
+
</p>
|
849 |
+
</td>
|
850 |
+
</tr>
|
851 |
+
<tr>
|
852 |
+
<td><label for="video_sitemap_meta">Sitemap Post Meta <a href="#" class="show-more">(?)</a>:</label></td>
|
853 |
+
<td>
|
854 |
+
<input id="video_sitemap_meta" name="video_sitemap_meta" type="text" value="" />
|
855 |
+
<p class="description"><span class="more">You can enter post meta keys here, use <code>,</code> to separate multiple values.</span></p>
|
856 |
+
</td>
|
857 |
+
</tr>
|
858 |
+
<tr>
|
859 |
+
<td colspan="4">
|
860 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
861 |
+
</td>
|
862 |
+
</tr>
|
863 |
+
</table>
|
864 |
+
</div>
|
865 |
+
</div>
|
866 |
+
<div id="fv_flowplayer_conversion" class="postbox " >
|
867 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Conversion</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Conversion</span></h2>
|
868 |
+
<div class="inside">
|
869 |
+
<p>This section allows you to convert videos posted using other plugins to FV Player shortcodes.</p>
|
870 |
+
<table class="form-table2" style="margin: 5px; ">
|
871 |
+
<tr>
|
872 |
+
<td>
|
873 |
+
<input type="button" class="button" value="Convert JW Player shortcodes" style="margin-top: 2ex;" onclick="if( confirm('This converts the [jwplayer] shortcodes into [fvplayer] shortcodes.\n\n Please make sure you backup your database before continuing. You can use revisions to get back to previos versions of your posts as well.') ) location.href='http://example.org/wp-admin/options-general.php?page=fvplayer&convert_jwplayer=f13b4f40a5'; "/>
|
874 |
+
</td>
|
875 |
+
</tr>
|
876 |
+
</table>
|
877 |
+
</div>
|
878 |
+
</div>
|
879 |
+
<div id="fv_player_pro" class="postbox " >
|
880 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Pro Features</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Pro Features</span></h2>
|
881 |
+
<div class="inside">
|
882 |
+
<p><a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/download">Purchase FV Flowplayer license</a> to enable Pro features!</p>
|
883 |
+
<table class="form-table2">
|
884 |
+
<tr>
|
885 |
+
<td class="first"><label>Advanced Vimeo embeding:</label></td>
|
886 |
+
<td>
|
887 |
+
<p class="description">
|
888 |
+
<input type="checkbox" checked="checked" disabled="true" />
|
889 |
+
Use Vimeo as your video host and use all of FV Flowplayer features. </p>
|
890 |
+
</td>
|
891 |
+
</tr>
|
892 |
+
<tr>
|
893 |
+
<td><label>Advanced YouTube embeding:</label></td>
|
894 |
+
<td>
|
895 |
+
<p class="description">
|
896 |
+
<input type="checkbox" checked="checked" disabled="true" />
|
897 |
+
Use YouTube as your video host and use all of FV Flowplayer features. </p>
|
898 |
+
</td>
|
899 |
+
</tr>
|
900 |
+
<tr>
|
901 |
+
<td><label>Enable user defined AB loop:</label></td>
|
902 |
+
<td>
|
903 |
+
<p class="description">
|
904 |
+
<input type="checkbox" checked="checked" disabled="true" />
|
905 |
+
Let your users repeat the parts of the video which they like! </p>
|
906 |
+
</td>
|
907 |
+
</tr>
|
908 |
+
<tr>
|
909 |
+
<td><label>Enable video lightbox:</label></td>
|
910 |
+
<td>
|
911 |
+
<p class="description">
|
912 |
+
<input type="checkbox" checked="checked" disabled="true" />
|
913 |
+
Enables Lightbox video gallery to show videos in a lightbox popup! </p>
|
914 |
+
</td>
|
915 |
+
</tr>
|
916 |
+
<tr>
|
917 |
+
<td><label>Enable quality switching:</label></td>
|
918 |
+
<td>
|
919 |
+
<p class="description">
|
920 |
+
<input type="checkbox" checked="checked" disabled="true" />
|
921 |
+
Upload your videos in multiple quality for best user experience with YouTube-like quality switching! </p>
|
922 |
+
</td>
|
923 |
+
</tr>
|
924 |
+
<tr>
|
925 |
+
<td><label>Amazon CloudFront protected content:</label></td>
|
926 |
+
<td>
|
927 |
+
<p class="description">
|
928 |
+
<input type="checkbox" checked="checked" disabled="true" />
|
929 |
+
Protect your Amazon CDN hosted videos.
|
930 |
+
</p>
|
931 |
+
</td>
|
932 |
+
</tr>
|
933 |
+
<tr>
|
934 |
+
<td><label>Autoplay just once:</label></td>
|
935 |
+
<td>
|
936 |
+
<p class="description">
|
937 |
+
<input type="checkbox" disabled="true" />
|
938 |
+
Makes sure each video autoplays only once for each visitor. </p>
|
939 |
+
</td>
|
940 |
+
</tr>
|
941 |
+
<tr>
|
942 |
+
<td><label>Enable video ads:</label></td>
|
943 |
+
<td>
|
944 |
+
<p class="description">
|
945 |
+
<input type="checkbox" disabled="true" />
|
946 |
+
Define your own videos ads to play in together with your videos - postroll or prerool </p>
|
947 |
+
</td>
|
948 |
+
</tr>
|
949 |
+
</table>
|
950 |
+
<p><strong>Upcoming pro features</strong>:</p>
|
951 |
+
<table class="form-table2">
|
952 |
+
<tr>
|
953 |
+
<td class="first"><label>Enable PayWall:</label></td>
|
954 |
+
<td>
|
955 |
+
<p class="description">
|
956 |
+
<input type="checkbox" checked="checked" disabled="true" />
|
957 |
+
Monetize the video content on your membership site. </p>
|
958 |
+
</td>
|
959 |
+
</tr>
|
960 |
+
</table>
|
961 |
+
</div>
|
962 |
+
</div>
|
963 |
+
</div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
|
964 |
+
</div>
|
965 |
+
<div id='postbox-container-tab_skin' class='postbox-container' style="">
|
966 |
+
<div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
|
967 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: </span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span> </span></h2>
|
968 |
+
<div class="inside">
|
969 |
+
<table class="form-table">
|
970 |
+
<tr>
|
971 |
+
<td colspan="4">
|
972 |
+
<p>
|
973 |
+
You can customize the colors of the player to match your website. </p>
|
974 |
+
</td>
|
975 |
+
</tr>
|
976 |
+
</table>
|
977 |
+
</div>
|
978 |
+
</div>
|
979 |
+
<div id="flowplayer-wrapper" class="postbox " >
|
980 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Player Skin</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Player Skin</span></h2>
|
981 |
+
<div class="inside">
|
982 |
+
<style id="fv-style-preview"></style>
|
983 |
+
<div class="flowplayer-wrapper">
|
984 |
+
<div id="wpfp_1b7da827d9fee9aa6d5bb9c5dca973bf" class="flowplayer no-brand is-splash fvp-play-button" style="max-width: 100%; background-image: url(https://i.vimeocdn.com/video/609485450_1280.jpg);" data-ratio="0.5625">
|
985 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
986 |
+
<div class='fvp-share-bar'><ul class="fvp-sharing">
|
987 |
+
<li><a class="sharing-facebook" href="https://www.facebook.com/sharer/sharer.php?u=" target="_blank">Facebook</a></li>
|
988 |
+
<li><a class="sharing-twitter" href="https://twitter.com/home?status=Test+Blog+" target="_blank">Twitter</a></li>
|
989 |
+
<li><a class="sharing-google" href="https://plus.google.com/share?url=" target="_blank">Google+</a></li>
|
990 |
+
<li><a class="sharing-email" href="mailto:?body=Check%20out%20the%20amazing%20video%20here%3A%20" target="_blank">Email</a></li></ul><div><label><a class="embed-code-toggle" href="#"><strong>Embed</strong></a></label></div><div class="embed-code"><label>Copy and paste this HTML code into your webpage to embed.</label><textarea></textarea></div></div>
|
991 |
+
</div>
|
992 |
+
Hint: play the video to see live preview of the color settings </div>
|
993 |
+
<table class="form-table2 flowplayer-settings fv-player-interface-form-group">
|
994 |
+
<tr>
|
995 |
+
<td><label for="hasBorder">Border</label></td>
|
996 |
+
<td><input type="hidden" name="hasBorder" value="false" />
|
997 |
+
<input type="checkbox" name="hasBorder" id="hasBorder" value="true"
|
998 |
+
data-fv-preview=".flowplayer{border:%val%px solid!important;}"/>
|
999 |
+
</td>
|
1000 |
+
|
1001 |
+
</tr>
|
1002 |
+
<tr>
|
1003 |
+
<td><label for="borderColor">Border color</label></td>
|
1004 |
+
<td><input class="color" id="borderColor" name="borderColor" type="text" value="#666666"
|
1005 |
+
data-fv-preview=".flowplayer{border-color:#%val%!important;}"/></td>
|
1006 |
+
</tr>
|
1007 |
+
<tr>
|
1008 |
+
<td><label for="marginBottom">Bottom Margin</label></td>
|
1009 |
+
<td><input id="marginBottom" name="marginBottom" title="Enter value in pixels" type="text" value="28"
|
1010 |
+
data-fv-preview=".flowplayer { margin: 0 auto %val%px auto!important; display: block!important; }
|
1011 |
+
.flowplayer.fixed-controls { margin: 0 auto calc(%val%px + 30px) auto!important; display: block!important; }
|
1012 |
+
.flowplayer.has-abloop { margin-bottom: %val%px!important; }
|
1013 |
+
.flowplayer.fixed-controls.has-abloop { margin-bottom: calc(%val%px + 30px)!important; }"/></td>
|
1014 |
+
</tr>
|
1015 |
+
<tr>
|
1016 |
+
<td><label for="bufferColor">Buffer</label></td>
|
1017 |
+
<td><input class="color" id="bufferColor" name="bufferColor" type="text" value="#eeeeee"
|
1018 |
+
data-fv-preview=".flowplayer .fp-volumeslider, .flowplayer .noUi-background { background-color: #%val% !important; }
|
1019 |
+
.flowplayer .fp-buffer, .flowplayer .fv-ab-loop .noUi-handle { background-color: #%val% !important; }" /></td>
|
1020 |
+
</tr>
|
1021 |
+
<tr>
|
1022 |
+
<td><label for="canvas">Canvas</label></td>
|
1023 |
+
<td><input class="color" id="canvas" name="canvas" type="text" value="#000000"
|
1024 |
+
data-fv-preview=".flowplayer { background-color: #%val%!important; }"/></td>
|
1025 |
+
</tr>
|
1026 |
+
<tr>
|
1027 |
+
<td><label for="backgroundColor">Controlbar</label></td>
|
1028 |
+
<td><input class="color" id="backgroundColor" name="backgroundColor" type="text" value="#333333"
|
1029 |
+
data-fv-preview=".flowplayer .fv-ab-loop .noUi-handle { color:#%val%!important; }
|
1030 |
+
.fv_player_popup { background: #%val%!important;}
|
1031 |
+
.fvfp_admin_error_content { background: #%val%!important; }
|
1032 |
+
.flowplayer .fp-controls, .flowplayer .fv-ab-loop, .fv-player-buttons a:active, .fv-player-buttons a { background-color: #%val% !important; }"/></td>
|
1033 |
+
</tr>
|
1034 |
+
<tr>
|
1035 |
+
<td><label for="font-face">Font Face</label></td>
|
1036 |
+
<td>
|
1037 |
+
<select id="font-face" name="font-face" data-fv-preview="#content .flowplayer, .flowplayer { font-family: %val%; }">
|
1038 |
+
<option value="inherit">(inherit from template)</option>
|
1039 |
+
<option value=""Courier New", Courier, monospace">Courier New</option>
|
1040 |
+
<option value="Tahoma, Geneva, sans-serif" selected="selected">Tahoma, Geneva</option>
|
1041 |
+
</select>
|
1042 |
+
</td>
|
1043 |
+
</tr>
|
1044 |
+
<tr>
|
1045 |
+
<td class="second-column"><label for="player-position">Player position</label></td>
|
1046 |
+
<td>
|
1047 |
+
<select id="player-position" name="player-position" data-fv-preview=".flowplayer { margin-left: 0; }">
|
1048 |
+
<option value="" selected="selected">Centered</option>
|
1049 |
+
<option value="left">Left (no text-wrap)</option>
|
1050 |
+
</select>
|
1051 |
+
</td>
|
1052 |
+
</tr>
|
1053 |
+
<tr>
|
1054 |
+
<td><label for="progressColor">Progress</label></td>
|
1055 |
+
<td><input class="color" id="progressColor" name="progressColor" type="text" value="#bb0000"
|
1056 |
+
data-fv-preview=".flowplayer .fp-volumelevel { background-color: #%val%!important; }
|
1057 |
+
.flowplayer .fp-progress, .flowplayer .fv-ab-loop .noUi-connect, .fv-player-buttons a.current { background-color: #%val% !important; }
|
1058 |
+
.flowplayer .fp-dropdown li.active { background-color: #%val% !important }"/></td>
|
1059 |
+
</tr>
|
1060 |
+
<tr>
|
1061 |
+
<td><label for="timeColor">Time</label></td>
|
1062 |
+
<td><input class="color" id="timeColor" name="timeColor" type="text" value="#eeeeee"
|
1063 |
+
data-fv-preview=".flowplayer .fp-elapsed { color: #%val% !important; }
|
1064 |
+
.fv-wp-flowplayer-notice-small { color: #%val% !important; }"/></td>
|
1065 |
+
</tr>
|
1066 |
+
<tr>
|
1067 |
+
<td><label for="durationColor">Total time</label></td>
|
1068 |
+
<td><input class="color" id="durationColor" name="durationColor" type="text" value="#eeeeee"
|
1069 |
+
data-fv-preview=".flowplayer .fp-controls, .flowplayer .fv-ab-loop, .fv-player-buttons a:active, .fv-player-buttons a { color:#%val% !important; }"/></td>
|
1070 |
+
</tr>
|
1071 |
+
<tr>
|
1072 |
+
<td colspan="2">
|
1073 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1074 |
+
</td>
|
1075 |
+
</tr>
|
1076 |
+
</table>
|
1077 |
+
<div style="clear: both"></div>
|
1078 |
+
</div>
|
1079 |
+
</div>
|
1080 |
+
<div id="fv_flowplayer_skin_playlist" class="postbox " >
|
1081 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Playlist</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Playlist</span></h2>
|
1082 |
+
<div class="inside">
|
1083 |
+
<div class="flowplayer-wrapper">
|
1084 |
+
<div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_1b7da827d9fee9aa6d5bb9c5dca973bf">
|
1085 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/196881410.hd.mp4?s=24645ecff21ff60079fc5b7715a97c00f90c6a18&profile_id=174&oauth2_token_id=3501005","type":"video\/mp4"}],"subtitles":[{"srclang":"en","label":"English","src":"http:\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/images\/test-subtitles.vtt"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/608654918_295x166.jpg")'></div><h4><span>Foliovision Video</span></h4></a>
|
1086 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/224781088.sd.mp4?s=face4dbb990b462826c8e1e43a9c66c6a9bb5585&profile_id=165&oauth2_token_id=3501005","type":"video\/mp4"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/643908843_295x166.jpg")'></div><h4><span>Lapinthrope Extras - Roy Thompson Hall Dance</span></h4></a>
|
1087 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/player.vimeo.com\/external\/45864857.hd.mp4?s=94fddee594da3258c9e10355f5bad8173c4aee7b&profile_id=113&oauth2_token_id=3501005","type":"video\/mp4"}]}'><div style='background-image: url("https://i.vimeocdn.com/video/319116053_295x166.jpg")'></div><h4><span>Romeo and Juliet Ballet Schloss Kittsee</span></h4></a>
|
1088 |
+
</div>
|
1089 |
+
Hint: you can click the thumbnails to switch videos in the above player. This preview uses the horizontal playlist style.
|
1090 |
+
</div>
|
1091 |
+
<table class="form-table2 flowplayer-settings fv-player-interface-form-group">
|
1092 |
+
<tr>
|
1093 |
+
<td><label for="playlist-design">Playlist Design</label></td>
|
1094 |
+
<td>
|
1095 |
+
<select id="playlist-design" name="playlist-design" data-fv-preview="">
|
1096 |
+
<option value="2017" selected="selected">2017</option>
|
1097 |
+
<option value="2017 visible-captions">2017 with captions</option>
|
1098 |
+
<option value="2014">2014</option>
|
1099 |
+
</select>
|
1100 |
+
</td>
|
1101 |
+
</tr>
|
1102 |
+
<tr>
|
1103 |
+
<td><label for="playlistBgColor">Background Color</label></td>
|
1104 |
+
<td><input class="color" id="playlistBgColor" name="playlistBgColor" type="text" value="#808080"
|
1105 |
+
data-fv-preview=".fp-playlist-external > a > span { background-color:#%val%; }"/></td>
|
1106 |
+
</tr>
|
1107 |
+
<tr>
|
1108 |
+
<td><label for="playlistSelectedColor">Active Item</label></td>
|
1109 |
+
<td><input class="color" id="playlistSelectedColor" name="playlistSelectedColor" type="text" value="#bb0000"
|
1110 |
+
data-fv-preview=".fp-playlist-external.fv-playlist-design-2014 a.is-active,.fp-playlist-external.fv-playlist-design-2014 a.is-active h4,.fp-playlist-external.fp-playlist-only-captions a.is-active,.fp-playlist-external.fp-playlist-only-captions a.is-active h4 { color:#%val%; }"/></td>
|
1111 |
+
</tr>
|
1112 |
+
<tr>
|
1113 |
+
<td><label for="playlistFontColor-proxy">Font Color</label></td>
|
1114 |
+
<td>
|
1115 |
+
<input class="color" id="playlistFontColor-proxy" data-previous="" style="display:none;" type="text" value="" />
|
1116 |
+
<input id="playlistFontColor" name="playlistFontColor" type="hidden" value=""
|
1117 |
+
data-fv-preview=".fp-playlist-external > a { color:#%val%; } #dashboard-widgets .flowplayer-wrapper .fp-playlist-external h4{color: #%val% !important;}"/>
|
1118 |
+
<a class="playlistFontColor-show" >Use custom color</a>
|
1119 |
+
<a class="playlistFontColor-hide" style="display:none;">Inherit from theme</a>
|
1120 |
+
</td>
|
1121 |
+
</tr>
|
1122 |
+
<tr>
|
1123 |
+
<td colspan="2">
|
1124 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1125 |
+
</td>
|
1126 |
+
</tr>
|
1127 |
+
</table>
|
1128 |
+
<div style="clear: both"></div>
|
1129 |
+
</div>
|
1130 |
+
</div>
|
1131 |
+
<div id="fv_flowplayer_skin_subtitles" class="postbox " >
|
1132 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Subtitles</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Subtitles</span></h2>
|
1133 |
+
<div class="inside">
|
1134 |
+
<table class="form-table2 flowplayer-settings fv-player-interface-form-group">
|
1135 |
+
<tr>
|
1136 |
+
<td><label for="subtitle-font-face">Font Face</label></td>
|
1137 |
+
<td>
|
1138 |
+
<select id="subtitle-font-face" name="subtitleFontFace" data-fv-preview=".flowplayer .fp-subtitle .fp-subtitle-line { font-family: %val%!important; }">
|
1139 |
+
<option value="inherit">(inherit)</option>
|
1140 |
+
<option value=""Courier New", Courier, monospace">Courier New</option>
|
1141 |
+
<option value="Tahoma, Geneva, sans-serif">Tahoma, Geneva</option>
|
1142 |
+
</select>
|
1143 |
+
</td>
|
1144 |
+
</tr>
|
1145 |
+
<tr>
|
1146 |
+
<td><label for="subtitleSize">Font Size</label></td>
|
1147 |
+
<td><input id="subtitleSize" name="subtitleSize" title="Enter value in pixels" type="text" value="16"
|
1148 |
+
data-fv-preview=".flowplayer .fp-subtitle .fp-subtitle-line { font-size: %val%px!important; }"/></td>
|
1149 |
+
</tr>
|
1150 |
+
<tr>
|
1151 |
+
<td><label for="subtitleBgColor">Background Color</label></td>
|
1152 |
+
<td><input class="color" id="subtitleBgColor" name="subtitleBgColor" type="text" value="#000000"
|
1153 |
+
data-fv-preview=".flowplayer .fp-subtitle .fp-subtitle-line { background-color: rgba(%val%)!important; }"/></td>
|
1154 |
+
</tr>
|
1155 |
+
<tr>
|
1156 |
+
<td><label for="subtitleBgAlpha">Background Opacity</label></td>
|
1157 |
+
<td><input id="subtitleBgAlpha" name="subtitleBgAlpha" type="range" min="0" max="1" step="0.01" value="0.5"
|
1158 |
+
data-fv-preview=""/></td>
|
1159 |
+
</tr>
|
1160 |
+
<tr>
|
1161 |
+
<td colspan="2">
|
1162 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1163 |
+
</td>
|
1164 |
+
</tr>
|
1165 |
+
</table>
|
1166 |
+
<div id="fp-preview-wrapper">
|
1167 |
+
<div class="flowplayer"id="preview">
|
1168 |
+
<div class="fp-subtitle fp-active">
|
1169 |
+
<span class="fp-subtitle-line">
|
1170 |
+
The quick brown fox jumps over the lazy dog. </span>
|
1171 |
+
</div>
|
1172 |
+
</div>
|
1173 |
+
</div>
|
1174 |
+
<div style="clear: both"></div>
|
1175 |
+
</div>
|
1176 |
+
</div>
|
1177 |
+
<div id="fv_flowplayer_skin_sticky" class="postbox " >
|
1178 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Sticky Video</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Sticky Video</span></h2>
|
1179 |
+
<div class="inside">
|
1180 |
+
<p>This feature lets your viewers continue watching the video as they scroll past it. It applies to desktop computer displays - minimal width of 1020 pixels.</p>
|
1181 |
+
<table class="form-table2 flowplayer-settings fv-player-interface-form-group">
|
1182 |
+
<tr>
|
1183 |
+
<td class="first"><label for="sticky_video">Enable:</label></td>
|
1184 |
+
<td>
|
1185 |
+
<p class="description">
|
1186 |
+
<input type="hidden" name="sticky_video" value="false"/>
|
1187 |
+
<input type="checkbox" name="sticky_video" id="sticky_video" value="true" />
|
1188 |
+
</p>
|
1189 |
+
</td>
|
1190 |
+
</tr>
|
1191 |
+
<tr>
|
1192 |
+
<td><label for="sticky_place">Placement</label></td>
|
1193 |
+
<td>
|
1194 |
+
<select id="sticky_place" name="sticky_place">
|
1195 |
+
<option value="right-bottom" selected="selected">Right, Bottom</option>
|
1196 |
+
<option value="left-bottom">Left, Bottom</option>
|
1197 |
+
<option value="left-top">Left, Top</option>
|
1198 |
+
<option value="right-top">Right, Top</option>
|
1199 |
+
</select>
|
1200 |
+
</td>
|
1201 |
+
</tr>
|
1202 |
+
<tr>
|
1203 |
+
<td><label for="sticky_width">Player width [px]</label></td>
|
1204 |
+
<td><input id="sticky_width" name="sticky_width" title="Enter value in pixels" type="text" value="380"/></td>
|
1205 |
+
</tr>
|
1206 |
+
|
1207 |
+
|
1208 |
+
<tr>
|
1209 |
+
<td colspan="2">
|
1210 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1211 |
+
</td>
|
1212 |
+
</tr>
|
1213 |
+
</table>
|
1214 |
+
<div style="clear: both"></div>
|
1215 |
+
</div>
|
1216 |
+
</div>
|
1217 |
+
</div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
|
1218 |
+
</div>
|
1219 |
+
<div id='postbox-container-tab_hosting' class='postbox-container' style="">
|
1220 |
+
<div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
|
1221 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: </span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span> </span></h2>
|
1222 |
+
<div class="inside">
|
1223 |
+
<table class="form-table">
|
1224 |
+
<tr>
|
1225 |
+
<td colspan="4">
|
1226 |
+
<p>
|
1227 |
+
Here you can enable and configure advanced hosting options. </p>
|
1228 |
+
</td>
|
1229 |
+
</tr>
|
1230 |
+
</table>
|
1231 |
+
</div>
|
1232 |
+
</div>
|
1233 |
+
<div id="fv_flowplayer_amazon_options" class="postbox " >
|
1234 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Amazon S3 Protected Content</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Amazon S3 Protected Content</span></h2>
|
1235 |
+
<div class="inside">
|
1236 |
+
<table class="form-table2">
|
1237 |
+
<tr>
|
1238 |
+
<td colspan="2">
|
1239 |
+
<p>Secured Amazon S3 URLs are recommended for member-only sections of the site. We check the video length and make sure the link expiration time is big enough for the video to buffer properly.</p>
|
1240 |
+
<p>If you use a cache plugin (such as Hyper Cache, WP Super Cache or W3 Total Cache), we recommend that you set the "Default Expiration Time" to twice as much as your cache timeout and check "Force the default expiration time". That way the video length won't be accounted and the video source URLs in your cached pages won't expire. Read more in the <a href="http://foliovision.com/wordpress/plugins/fv-wordpress-flowplayer/secure-amazon-s3-guide#wp-cache" target="_blank">Using Amazon S3 secure content in FV Flowplayer guide</a>.</p>
|
1241 |
+
</td>
|
1242 |
+
</tr>
|
1243 |
+
<tr>
|
1244 |
+
<td class="first"><label for="amazon_expire">Default Expiration Time [minutes] (<abbr title="Each video duration is stored on post save and then used as the expire time. If the duration is not available, this value is used.">?</abbr>):</label></td>
|
1245 |
+
<td>
|
1246 |
+
<input type="text" size="40" name="amazon_expire" id="amazon_expire" value="5" />
|
1247 |
+
</td>
|
1248 |
+
</tr>
|
1249 |
+
<tr>
|
1250 |
+
<td class="first"><label for="amazon_expire_force">Force the default expiration time:</label></td>
|
1251 |
+
<td>
|
1252 |
+
<p class="description">
|
1253 |
+
<input type="hidden" name="amazon_expire_force" value="false"/>
|
1254 |
+
<input type="checkbox" name="amazon_expire_force" id="amazon_expire_force" value="true" />
|
1255 |
+
</p>
|
1256 |
+
</td>
|
1257 |
+
</tr>
|
1258 |
+
<tr>
|
1259 |
+
<td><label for="s3_browser">Amazon S3 Browser (beta):</label></td>
|
1260 |
+
<td>
|
1261 |
+
<p class="description">
|
1262 |
+
<input type="hidden" name="s3_browser" value="false"/>
|
1263 |
+
<input type="checkbox" name="s3_browser" id="s3_browser" value="true" />
|
1264 |
+
Show Amazon S3 Browser in the "Add Video" dialog. </p>
|
1265 |
+
</td>
|
1266 |
+
</tr>
|
1267 |
+
|
1268 |
+
<tr class="amazon-s3-first">
|
1269 |
+
<td><label for="amazon_bucket[]">Amazon Bucket (<abbr title="We recommend that you simply put all of your protected video into a single bucket and enter its name here. All matching videos will use the protected URLs.">?</abbr>):</label></td>
|
1270 |
+
<td><input id="amazon_bucket[]" name="amazon_bucket[]" type="text" value="" /></td>
|
1271 |
+
</tr>
|
1272 |
+
<tr class="amazon-s3-first">
|
1273 |
+
<td><label for="amazon_region[]">Region</td>
|
1274 |
+
<td>
|
1275 |
+
<select id="amazon_region[]" name="amazon_region[]">
|
1276 |
+
<option value="">Select the region</option>
|
1277 |
+
<option value="us-east-1">US East (N. Virginia)</option>
|
1278 |
+
|
1279 |
+
<option value="us-east-2">US East (Ohio)</option>
|
1280 |
+
|
1281 |
+
<option value="us-west-1">US West (N. California)</option>
|
1282 |
+
|
1283 |
+
<option value="us-west-2">US West (Oregon)</option>
|
1284 |
+
|
1285 |
+
<option value="ca-central-1">Canada (Central)</option>
|
1286 |
+
|
1287 |
+
<option value="ap-south-1">Asia Pacific (Mumbai)</option>
|
1288 |
+
|
1289 |
+
<option value="ap-northeast-2">Asia Pacific (Seoul)</option>
|
1290 |
+
|
1291 |
+
<option value="ap-southeast-1">Asia Pacific (Singapore)</option>
|
1292 |
+
|
1293 |
+
<option value="ap-southeast-2">Asia Pacific (Sydney)</option>
|
1294 |
+
|
1295 |
+
<option value="ap-northeast-1">Asia Pacific (Tokyo)</option>
|
1296 |
+
|
1297 |
+
<option value="eu-central-1">EU (Frankfurt)</option>
|
1298 |
+
|
1299 |
+
<option value="eu-west-1">EU (Ireland)</option>
|
1300 |
+
|
1301 |
+
<option value="eu-west-2">EU (London)</option>
|
1302 |
+
|
1303 |
+
<option value="sa-east-1">South America (São Paulo)</option>
|
1304 |
+
</select>
|
1305 |
+
</td>
|
1306 |
+
</tr>
|
1307 |
+
<tr class="amazon-s3-first">
|
1308 |
+
<td><label for="amazon_key[]">Access Key ID:</label></td>
|
1309 |
+
<td><input id="amazon_key[]" name="amazon_key[]" type="text" value="" /></td>
|
1310 |
+
</tr>
|
1311 |
+
<tr class="amazon-s3-first">
|
1312 |
+
<td><label for="amazon_secret[]">Secret Access Key:</label></td>
|
1313 |
+
<td><input id="amazon_secret[]" name="amazon_secret[]" type="text" value="" /></td>
|
1314 |
+
</tr>
|
1315 |
+
<tr class="amazon-s3-first">
|
1316 |
+
<td colspan="2">
|
1317 |
+
<div class="alignright fv_fp_amazon_remove">
|
1318 |
+
<a href="#" onclick="fv_fp_amazon_s3_remove(this); return false">remove</a>
|
1319 |
+
</div>
|
1320 |
+
<div class="clear"></div>
|
1321 |
+
<hr style="border: 0; border-top: 1px solid #ccc;" />
|
1322 |
+
</td>
|
1323 |
+
</tr>
|
1324 |
+
|
1325 |
+
<tr class="amazon-s3-last"><td colspan="2"></td></tr>
|
1326 |
+
<tr>
|
1327 |
+
<td colspan="4">
|
1328 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1329 |
+
<input type="button" id="amazon-s3-add" class="button" value="Add more Amazon S3 secure buckets" />
|
1330 |
+
</td>
|
1331 |
+
</tr>
|
1332 |
+
</table>
|
1333 |
+
</div>
|
1334 |
+
</div>
|
1335 |
+
</div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
|
1336 |
+
</div>
|
1337 |
+
<div id='postbox-container-tab_actions' class='postbox-container' style="">
|
1338 |
+
<div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_description" class="postbox " >
|
1339 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: </span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span> </span></h2>
|
1340 |
+
<div class="inside">
|
1341 |
+
<table class="form-table">
|
1342 |
+
<tr>
|
1343 |
+
<td colspan="4">
|
1344 |
+
<p>
|
1345 |
+
Here you can configure ads and banners that will be shown in the video. </p>
|
1346 |
+
</td>
|
1347 |
+
</tr>
|
1348 |
+
</table>
|
1349 |
+
</div>
|
1350 |
+
</div>
|
1351 |
+
<div id="fv_flowplayer_end_of_video" class="postbox " >
|
1352 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: End of Video</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>End of Video</span></h2>
|
1353 |
+
<div class="inside">
|
1354 |
+
<table class="form-table2" style="margin: 5px; ">
|
1355 |
+
<tr>
|
1356 |
+
<td style="width:150px;vertical-align:top;line-height:2.4em;"><label for="popups_default">Default Popup:</label></td>
|
1357 |
+
<td>
|
1358 |
+
|
1359 |
+
<p class="description"> <select id="popups_default" name="popups_default">
|
1360 |
+
<option selected value="no">None</option>
|
1361 |
+
<option value="random">Random</option>
|
1362 |
+
<option value="email-1">email-1 - Subscribe to list one</option> </select>
|
1363 |
+
You can set a default popup here and then skip it for individual videos.</p>
|
1364 |
+
</td>
|
1365 |
+
</tr>
|
1366 |
+
<tr>
|
1367 |
+
<td colspan="4">
|
1368 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1369 |
+
</td>
|
1370 |
+
</tr>
|
1371 |
+
</table>
|
1372 |
+
</div>
|
1373 |
+
</div>
|
1374 |
+
<div id="fv_flowplayer_popups" class="postbox " >
|
1375 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Custom Popups</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Custom Popups</span></h2>
|
1376 |
+
<div class="inside">
|
1377 |
+
<p>Add any popups here which you would like to use with multiple videos.</p>
|
1378 |
+
<table class="form-table2" style="margin: 5px; ">
|
1379 |
+
<tr>
|
1380 |
+
<td>
|
1381 |
+
<table id="fv-player-popups-settings">
|
1382 |
+
<thead>
|
1383 |
+
<tr>
|
1384 |
+
<td>ID</td>
|
1385 |
+
<td></td>
|
1386 |
+
<td>Status</td>
|
1387 |
+
</tr>
|
1388 |
+
</thead>
|
1389 |
+
<tbody>
|
1390 |
+
<tr class='data' id="fv-player-popup-item-1">
|
1391 |
+
<td class='id'>1</td>
|
1392 |
+
<td>
|
1393 |
+
<table class='fv-player-popup-formats'>
|
1394 |
+
<tr>
|
1395 |
+
<td><label>Name:</label></td>
|
1396 |
+
<td><input type='text' maxlength="40" name='popups[1][name]' value='' placeholder='' /></td>
|
1397 |
+
</tr>
|
1398 |
+
<tr>
|
1399 |
+
<td><label>HTML:</label></td>
|
1400 |
+
<td><textarea class="large-text code" type='text' name='popups[1][html]' placeholder=''></textarea></td>
|
1401 |
+
</tr>
|
1402 |
+
<tr>
|
1403 |
+
<td><label>Custom<br />CSS:</label></td>
|
1404 |
+
<td><textarea class="large-text code" type='text' name='popups[1][css]' placeholder='.fv_player_popup-1 { }'></textarea></td>
|
1405 |
+
</tr>
|
1406 |
+
</table>
|
1407 |
+
</td>
|
1408 |
+
<td>
|
1409 |
+
<input type='hidden' name='popups[1][disabled]' value='0' />
|
1410 |
+
<input id='PopupAdDisabled-1' type='checkbox' name='popups[1][disabled]' value='1' />
|
1411 |
+
<label for='PopupAdDisabled-1'>Disable</label><br />
|
1412 |
+
<a class='fv-player-popup-remove' href=''>Remove</a></td>
|
1413 |
+
</tr>
|
1414 |
+
</tbody>
|
1415 |
+
</table>
|
1416 |
+
</td>
|
1417 |
+
</tr>
|
1418 |
+
<tr>
|
1419 |
+
<td>
|
1420 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1421 |
+
<input type="button" value="Add more Popups" class="button" id="fv-player-popups-add" />
|
1422 |
+
</td>
|
1423 |
+
</tr>
|
1424 |
+
</table>
|
1425 |
+
|
1426 |
+
<script>
|
1427 |
+
|
1428 |
+
jQuery('#fv-player-popups-add').click( function() {
|
1429 |
+
var fv_player_popup_index = (parseInt( jQuery('#fv-player-popups-settings tr.data:last .id').html() ) || 0 ) + 1;
|
1430 |
+
jQuery('#fv-player-popups-settings').append(jQuery('#fv-player-popups-settings tr.data:first').prop('outerHTML').replace(/#fv_popup_dummy_key#/gi,fv_player_popup_index + ""));
|
1431 |
+
jQuery('#fv-player-popup-item-'+fv_player_popup_index).show();
|
1432 |
+
return false;
|
1433 |
+
} );
|
1434 |
+
|
1435 |
+
jQuery(document).on('click','.fv-player-popup-remove', false, function() {
|
1436 |
+
if( confirm('Are you sure you want to remove the popup ad?') ){
|
1437 |
+
jQuery(this).parents('.data').remove();
|
1438 |
+
if(jQuery('#fv-player-popups-settings .data').length === 1) {
|
1439 |
+
jQuery('#fv-player-popups-add').trigger('click');
|
1440 |
+
}
|
1441 |
+
}
|
1442 |
+
return false;
|
1443 |
+
} );
|
1444 |
+
</script>
|
1445 |
+
</div>
|
1446 |
+
</div>
|
1447 |
+
<div id="fv_flowplayer_email_lists" class="postbox " >
|
1448 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Email Popups</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Email Popups</span></h2>
|
1449 |
+
<div class="inside">
|
1450 |
+
<p>Lists defined here can be used for subscription box for each video or for Default Popup above.</p>
|
1451 |
+
<table class="form-table2" style="margin: 5px; ">
|
1452 |
+
<tr>
|
1453 |
+
<td>
|
1454 |
+
<table id="fv-player-email_lists-settings">
|
1455 |
+
<thead>
|
1456 |
+
<tr>
|
1457 |
+
<td>ID</td>
|
1458 |
+
<td style="width: 40%">Properties</td>
|
1459 |
+
<td>Export</td>
|
1460 |
+
<td>Options</td>
|
1461 |
+
<td>Status</td>
|
1462 |
+
<td></td>
|
1463 |
+
</tr>
|
1464 |
+
</thead>
|
1465 |
+
<tbody>
|
1466 |
+
<tr class='data' id="fv-player-list-item-#fv_list_dummy_key#"style="display:none">
|
1467 |
+
<td class='id'>#fv_list_dummy_key#</td>
|
1468 |
+
<td>
|
1469 |
+
<table>
|
1470 |
+
<tr>
|
1471 |
+
<td style="width:16%"><label>Header</label></td>
|
1472 |
+
<td><input type='text' name='email_lists[#fv_list_dummy_key#][title]' value='' /></td>
|
1473 |
+
</tr>
|
1474 |
+
<tr>
|
1475 |
+
<td><label>Message</label></td>
|
1476 |
+
<td><input type='text' name='email_lists[#fv_list_dummy_key#][description]' value='' /></td>
|
1477 |
+
</tr>
|
1478 |
+
</table>
|
1479 |
+
</td>
|
1480 |
+
<td>
|
1481 |
+
<a class='fv-player-list-export' href='http://example.org/wp-admin/options-general.php?page=fvplayer&fv-email-export=#fv_list_dummy_key#' target="_blank" >Download CSV</a>
|
1482 |
+
<br />
|
1483 |
+
<a class='fv-player-list-export' href='http://example.org/wp-admin/options-general.php?page=fvplayer&fv-email-export-screen=#fv_list_dummy_key#' target="_blank" >View list</a>
|
1484 |
+
</td>
|
1485 |
+
<td>
|
1486 |
+
<input type='hidden' name='email_lists[#fv_list_dummy_key#][first_name]' value='0' />
|
1487 |
+
<input id='list-first-name-#fv_list_dummy_key#' title="first name" type='checkbox' name='email_lists[#fv_list_dummy_key#][first_name]' value='1' />
|
1488 |
+
<label for='list-first-name-#fv_list_dummy_key#'>First Name</label>
|
1489 |
+
<br />
|
1490 |
+
<input type='hidden' name='email_lists[#fv_list_dummy_key#][last_name]' value='0' />
|
1491 |
+
<input id='list-last-name-#fv_list_dummy_key#' title="last name" type='checkbox' name='email_lists[#fv_list_dummy_key#][last_name]' value='1' />
|
1492 |
+
<label for='list-last-name-#fv_list_dummy_key#'>Last Name</label>
|
1493 |
+
</td>
|
1494 |
+
<td>
|
1495 |
+
<input type='hidden' name='email_lists[#fv_list_dummy_key#][disabled]' value='0' />
|
1496 |
+
<input id='ListAdDisabled-#fv_list_dummy_key#' type='checkbox' title="disable" name='email_lists[#fv_list_dummy_key#][disabled]' value='1' />
|
1497 |
+
<label for='ListAdDisabled-#fv_list_dummy_key#'>Disable</label>
|
1498 |
+
<br />
|
1499 |
+
<a class='fv-player-list-remove' href=''>Remove</a>
|
1500 |
+
</td>
|
1501 |
+
<td>
|
1502 |
+
<input type="button" style="visibility: hidden" class="fv_player_email_list_save button" value="Save & Preview" />
|
1503 |
+
</td>
|
1504 |
+
</tr>
|
1505 |
+
<tr class='data' id="fv-player-list-item-1">
|
1506 |
+
<td class='id'>1</td>
|
1507 |
+
<td>
|
1508 |
+
<table>
|
1509 |
+
<tr>
|
1510 |
+
<td style="width:16%"><label>Header</label></td>
|
1511 |
+
<td><input type='text' name='email_lists[1][title]' value='Subscribe to list one' /></td>
|
1512 |
+
</tr>
|
1513 |
+
<tr>
|
1514 |
+
<td><label>Message</label></td>
|
1515 |
+
<td><input type='text' name='email_lists[1][description]' value='Two good reasons to subscribe right now' /></td>
|
1516 |
+
</tr>
|
1517 |
+
</table>
|
1518 |
+
</td>
|
1519 |
+
<td>
|
1520 |
+
<a class='fv-player-list-export' href='http://example.org/wp-admin/options-general.php?page=fvplayer&fv-email-export=1' target="_blank" >Download CSV</a>
|
1521 |
+
<br />
|
1522 |
+
<a class='fv-player-list-export' href='http://example.org/wp-admin/options-general.php?page=fvplayer&fv-email-export-screen=1' target="_blank" >View list</a>
|
1523 |
+
</td>
|
1524 |
+
<td>
|
1525 |
+
<input type='hidden' name='email_lists[1][first_name]' value='0' />
|
1526 |
+
<input id='list-first-name-1' title="first name" type='checkbox' name='email_lists[1][first_name]' value='1' checked="checked" />
|
1527 |
+
<label for='list-first-name-1'>First Name</label>
|
1528 |
+
<br />
|
1529 |
+
<input type='hidden' name='email_lists[1][last_name]' value='0' />
|
1530 |
+
<input id='list-last-name-1' title="last name" type='checkbox' name='email_lists[1][last_name]' value='1' />
|
1531 |
+
<label for='list-last-name-1'>Last Name</label>
|
1532 |
+
</td>
|
1533 |
+
<td>
|
1534 |
+
<input type='hidden' name='email_lists[1][disabled]' value='0' />
|
1535 |
+
<input id='ListAdDisabled-1' type='checkbox' title="disable" name='email_lists[1][disabled]' value='1' />
|
1536 |
+
<label for='ListAdDisabled-1'>Disable</label>
|
1537 |
+
<br />
|
1538 |
+
<a class='fv-player-list-remove' href=''>Remove</a>
|
1539 |
+
</td>
|
1540 |
+
<td>
|
1541 |
+
<input type="button" style="visibility: hidden" class="fv_player_email_list_save button" value="Save & Preview" />
|
1542 |
+
</td>
|
1543 |
+
</tr>
|
1544 |
+
</tbody>
|
1545 |
+
</table>
|
1546 |
+
</td>
|
1547 |
+
</tr>
|
1548 |
+
<tr>
|
1549 |
+
<td>
|
1550 |
+
<input type="button" value="Add More Lists" class="button" id="fv-player-email_lists-add" />
|
1551 |
+
</td>
|
1552 |
+
</tr>
|
1553 |
+
</table>
|
1554 |
+
|
1555 |
+
<script>
|
1556 |
+
jQuery('#fv-player-email_lists-add').click( function() {
|
1557 |
+
var fv_player_list_index = (parseInt( jQuery('#fv-player-email_lists-settings tr.data:last .id').html() ) || 0 ) + 1;
|
1558 |
+
jQuery('#fv-player-email_lists-settings').append(jQuery('#fv-player-email_lists-settings tr.data:first').prop('outerHTML').replace(/#fv_list_dummy_key#/gi,fv_player_list_index + ""));
|
1559 |
+
jQuery('#fv-player-list-item-' + fv_player_list_index).show();
|
1560 |
+
return false;
|
1561 |
+
} );
|
1562 |
+
|
1563 |
+
jQuery(document).on('click','.fv-player-list-remove', false, function() {
|
1564 |
+
if( confirm('Are you sure you want to remove the list?') ){
|
1565 |
+
jQuery(this).parents('.data').remove();
|
1566 |
+
if(jQuery('#fv-player-email_lists-settings .data').length === 1) {
|
1567 |
+
jQuery('#fv-player-email_lists-add').trigger('click');
|
1568 |
+
}
|
1569 |
+
}
|
1570 |
+
return false;
|
1571 |
+
} );
|
1572 |
+
|
1573 |
+
jQuery(document).on('keydown change', '#fv-player-email_lists-settings', function(e) {
|
1574 |
+
var row = jQuery(e.target).parents('[id^="fv-player-list-item-"]');
|
1575 |
+
row.find('.fv_player_email_list_save').css('visibility','visible');
|
1576 |
+
});
|
1577 |
+
jQuery(document).on('click', '#fv-player-email_lists-settings input[type=checkbox]', function(e) {
|
1578 |
+
var row = jQuery(e.target).parents('[id^="fv-player-list-item-"]');
|
1579 |
+
row.find('.fv_player_email_list_save').css('visibility','visible');
|
1580 |
+
});
|
1581 |
+
|
1582 |
+
jQuery(document).on('click', '.fv_player_email_list_save', function() {
|
1583 |
+
var button = jQuery(this);
|
1584 |
+
var row = button.parents('[id^="fv-player-list-item-"]');
|
1585 |
+
var aInputs = row.find('input, select');
|
1586 |
+
var key = row.attr('id').replace(/fv-player-list-item-/,'');
|
1587 |
+
|
1588 |
+
fv_player_open_preview_window(null,640,360+100);
|
1589 |
+
|
1590 |
+
button.prop('disabled',true);
|
1591 |
+
jQuery.ajax( {
|
1592 |
+
type: "POST",
|
1593 |
+
url: ajaxurl,
|
1594 |
+
data: aInputs.serialize()+'&key='+key+'&action=fv_player_email_subscription_save&_wpnonce=71bf337548',
|
1595 |
+
success: function(response) {
|
1596 |
+
button.css('visibility','hidden');
|
1597 |
+
button.prop('disabled', false);
|
1598 |
+
|
1599 |
+
row.replaceWith( jQuery('#'+row.attr('id'),response) );
|
1600 |
+
|
1601 |
+
var shortcode = '[fvplayer src="https://player.vimeo.com/external/196881410.hd.mp4?s=24645ecff21ff60079fc5b7715a97c00f90c6a18&profile_id=174&oauth2_token_id=3501005" splash="https://i.vimeocdn.com/video/609485450_1280.jpg" preroll="no" postroll="no" subtitles="http://example.org/wp-content/plugins/fv-wordpress-flowplayer/images/test-subtitles.vtt" end_popup_preview="true" popup="email-#key#" caption="This is how the popup will appear at the end of a video"]';
|
1602 |
+
shortcode = shortcode.replace(/#key#/,key);
|
1603 |
+
|
1604 |
+
var url = 'http://example.org?fv_player_embed=1&fv_player_preview=' + b64EncodeUnicode(shortcode);
|
1605 |
+
fv_player_open_preview_window(url);
|
1606 |
+
},
|
1607 |
+
error: function() {
|
1608 |
+
button.val('Error saving!');
|
1609 |
+
}
|
1610 |
+
} );
|
1611 |
+
});
|
1612 |
+
</script>
|
1613 |
+
</div>
|
1614 |
+
</div>
|
1615 |
+
<div id="fv_flowplayer_email_integration" class="postbox " >
|
1616 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Email Integration</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Email Integration</span></h2>
|
1617 |
+
<div class="inside">
|
1618 |
+
<p>Enter your service API key and then assign it to a list which you create above.</p>
|
1619 |
+
<table class="form-table2" style="margin: 5px; ">
|
1620 |
+
<tr>
|
1621 |
+
<td style="width: 250px"><label for="mailchimp_api">Mailchimp API key:</label></td>
|
1622 |
+
<td>
|
1623 |
+
<p class="description">
|
1624 |
+
<input type="text" name="mailchimp_api" id="mailchimp_api" value="" />
|
1625 |
+
</p>
|
1626 |
+
</td>
|
1627 |
+
</tr>
|
1628 |
+
<tr>
|
1629 |
+
<td></td>
|
1630 |
+
<td>
|
1631 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1632 |
+
</td>
|
1633 |
+
</tr>
|
1634 |
+
</table>
|
1635 |
+
</div>
|
1636 |
+
</div>
|
1637 |
+
<div id="fv_flowplayer_ads" class="postbox " >
|
1638 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Ads</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Ads</span></h2>
|
1639 |
+
<div class="inside">
|
1640 |
+
<table class="form-table2">
|
1641 |
+
<tr>
|
1642 |
+
<td colspan="2">
|
1643 |
+
<label for="ad">Default Ad Code:</label><br />
|
1644 |
+
<textarea id="ad" name="ad" class="large-text code"></textarea>
|
1645 |
+
</td>
|
1646 |
+
</tr>
|
1647 |
+
<tr>
|
1648 |
+
<td colspan="2"><label for="ad_width">Default set size [px]:</label>
|
1649 |
+
<label for="ad_width">W:</label> <input type="text" name="ad_width" id="ad_width" value="0" class="small" />
|
1650 |
+
<label for="ad_height">H:</label> <input type="text" name="ad_height" id="ad_height" value="0" class="small" />
|
1651 |
+
<label for="adTextColor">Ad text</label> <input class="color small" type="text" name="adTextColor" id="adTextColor" value="#888" />
|
1652 |
+
<label for="adLinksColor">Ad links</label> <input class="color small" type="text" name="adLinksColor" id="adLinksColor" value="#ff3333" />
|
1653 |
+
</td>
|
1654 |
+
</tr>
|
1655 |
+
<tr>
|
1656 |
+
<td>
|
1657 |
+
<label for="ad_show_after">Show After [s]:</label> <input type="text" name="ad_show_after" id="ad_show_after" value="0" class="small" />
|
1658 |
+
</td>
|
1659 |
+
</tr>
|
1660 |
+
<tr>
|
1661 |
+
<td colspan="2">
|
1662 |
+
<label for="ad_css_select">Ad CSS:</label>
|
1663 |
+
<a href="#" onclick="jQuery('.ad_css_wrap').show(); jQuery(this).hide(); return false">Show styling options</a>
|
1664 |
+
<div class="ad_css_wrap" style="display: none; ">
|
1665 |
+
<select id="ad_css_select">
|
1666 |
+
<option value="">Select your preset</option>
|
1667 |
+
<option value=".wpfp_custom_ad { position: absolute; bottom: 10%; z-index: 20; width: 100%; }
|
1668 |
+
.wpfp_custom_ad_content { background: white; margin: 0 auto; position: relative }" selected="selected">Default (white, centered above the control bar)</option>
|
1669 |
+
<option value=".wpfp_custom_ad { position: absolute; bottom: 0; z-index: 20; width: 100%; }
|
1670 |
+
.wpfp_custom_ad_content { background: white; margin: 0 auto; position: relative }">White, centered at the bottom of the video</option>
|
1671 |
+
</select>
|
1672 |
+
<br />
|
1673 |
+
<textarea rows="5" name="ad_css" id="ad_css" class="large-text code">.wpfp_custom_ad { position: absolute; bottom: 10%; z-index: 20; width: 100%; }
|
1674 |
+
.wpfp_custom_ad_content { background: white; margin: 0 auto; position: relative }</textarea>
|
1675 |
+
<p class="description">(Hint: put .wpfp_custom_ad_content before your own CSS selectors)</p>
|
1676 |
+
<script type="text/javascript">
|
1677 |
+
jQuery('#ad_css_select').change( function() {
|
1678 |
+
if( jQuery('#ad_css_select option:selected').val().length > 0 && jQuery('#ad_css_select option:selected').val() != jQuery('#ad_css').val() && confirm('Are you sure you want to apply the preset?') ) {
|
1679 |
+
jQuery('#ad_css').val( jQuery('#ad_css_select option:selected').val() );
|
1680 |
+
}
|
1681 |
+
} );
|
1682 |
+
</script>
|
1683 |
+
</div>
|
1684 |
+
</td>
|
1685 |
+
</tr>
|
1686 |
+
<tr>
|
1687 |
+
<td colspan="4">
|
1688 |
+
<input type="submit" name="fv-wp-flowplayer-submit" class="button-primary" value="Save All Changes" />
|
1689 |
+
</td>
|
1690 |
+
</tr>
|
1691 |
+
</table>
|
1692 |
+
</div>
|
1693 |
+
</div>
|
1694 |
+
</div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
|
1695 |
+
</div>
|
1696 |
+
<div id='postbox-container-tab_video_intelligence' class='postbox-container' style="">
|
1697 |
+
<div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_video_intelligence" class="postbox " >
|
1698 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: video intelligence</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>video intelligence</span></h2>
|
1699 |
+
<div class="inside">
|
1700 |
+
<style>
|
1701 |
+
#fv_flowplayer_video_intelligence_revival { display: none }
|
1702 |
+
</style>
|
1703 |
+
<input type="hidden" id="nonce_fv_player_vi_install" name="nonce_fv_player_vi_install" value="d9672c9ed6" /><input type="hidden" name="_wp_http_referer" value="" />
|
1704 |
+
<table class="form-table2" style="margin: 5px; ">
|
1705 |
+
<tbody>
|
1706 |
+
<tr>
|
1707 |
+
<td class="first">
|
1708 |
+
<img src="http://example.org/wp-content/plugins/fv-wordpress-flowplayer/images/vi-logo.svg" alt="video intelligence logo" />
|
1709 |
+
<a href="https://vi.ai/publisher-video-monetization/?aid=foliovision&email=&url=http://example.org&invtype=3#publisher_signup" target="_blank" class="button vi-register">Learn More</a>
|
1710 |
+
</td>
|
1711 |
+
<td>
|
1712 |
+
<p>Video content and video advertising – powered by <strong>video intelligence</strong></p>
|
1713 |
+
<p>Advertisers pay more for video advertising when it's matched with video content. This new video player will insert both on your page. It increases time on site, and commands a higher CPM than display advertising.</p>
|
1714 |
+
<p>You'll see video content that is matched to your sites keywords straight away. A few days after activation you'll begin to receive revenue from advertising served before this video content.</p>
|
1715 |
+
<ul>
|
1716 |
+
<li>The set up takes only a few minutes</li>
|
1717 |
+
<li>Up to 10x higher CPM than traditional display advertising</li>
|
1718 |
+
<li>Users spend longer on your site thanks to professional video content</li>
|
1719 |
+
</ul>
|
1720 |
+
</td>
|
1721 |
+
</tr>
|
1722 |
+
<tr>
|
1723 |
+
<td></td>
|
1724 |
+
<td>
|
1725 |
+
<p>By clicking sign up you agree to send your current domain, email and affiliate ID to video intelligence.</p>
|
1726 |
+
<a href="https://vi.ai/publisher-video-monetization/?aid=foliovision&email=&url=http://example.org&invtype=3#publisher_signup" target="_blank" class="button vi-register">Learn More or Create an Account</a>
|
1727 |
+
</td>
|
1728 |
+
</tr>
|
1729 |
+
</tbody>
|
1730 |
+
</table>
|
1731 |
+
|
1732 |
+
</div>
|
1733 |
+
</div>
|
1734 |
+
<div id="fv_flowplayer_video_intelligence_account" class="postbox " >
|
1735 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Account</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Account</span></h2>
|
1736 |
+
<div class="inside">
|
1737 |
+
<input type="hidden" id="nonce_fv_player_vi_install" name="nonce_fv_player_vi_install" value="d9672c9ed6" /><input type="hidden" name="_wp_http_referer" value="" />
|
1738 |
+
<table class="form-table2" style="margin: 5px; ">
|
1739 |
+
<tbody>
|
1740 |
+
<tr>
|
1741 |
+
<td class="first"><label for="vi_login">Login:</label></td>
|
1742 |
+
<td>
|
1743 |
+
<p class="description">
|
1744 |
+
<input type="text" name="vi_login" id="vi_login" class="medium" />
|
1745 |
+
</p>
|
1746 |
+
</td>
|
1747 |
+
</tr>
|
1748 |
+
<tr>
|
1749 |
+
<td><label for="vi_pass">Password:</label></td>
|
1750 |
+
<td>
|
1751 |
+
<p class="description">
|
1752 |
+
<input type="password" name="vi_pass" id="vi_pass" class="medium" />
|
1753 |
+
</p>
|
1754 |
+
</td>
|
1755 |
+
</tr>
|
1756 |
+
<tr>
|
1757 |
+
<td>
|
1758 |
+
</td>
|
1759 |
+
<td>
|
1760 |
+
<input type="submit" name="fv_player_vi_install" value="Sign in" class="button-primary">
|
1761 |
+
</td>
|
1762 |
+
</tr>
|
1763 |
+
<tr>
|
1764 |
+
<td></td>
|
1765 |
+
<td>
|
1766 |
+
<p><a href="mailto:support@vi.ai?Subject=Issues%20with%20account%20activation%20for%20http%3A%2F%2Fexample.org">I'm having issues with the account activation</a></p>
|
1767 |
+
</td>
|
1768 |
+
</tr>
|
1769 |
+
</tbody>
|
1770 |
+
</table>
|
1771 |
+
|
1772 |
+
|
1773 |
+
|
1774 |
+
</div>
|
1775 |
+
</div>
|
1776 |
+
<div id="fv_flowplayer_video_intelligence_hide" class="postbox " >
|
1777 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Hide vi Ads</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Hide vi Ads</span></h2>
|
1778 |
+
<div class="inside">
|
1779 |
+
<input id="fv-player-vi-remove" type="checkbox"> <label for="fv-player-vi-remove">Hide the vi Ads tab</label>
|
1780 |
+
<script>
|
1781 |
+
jQuery( function($) {
|
1782 |
+
$('#fv-player-vi-remove').click( function() {
|
1783 |
+
$.post(ajaxurl, {action:'fv-player-vi-remove'}, function() {
|
1784 |
+
$('#fv-player-vi-give-back').prop('checked',false);
|
1785 |
+
$('[href=#postbox-container-tab_video_intelligence]').hide();
|
1786 |
+
$('#fv_flowplayer_video_intelligence').hide();
|
1787 |
+
$('[href=#postbox-container-tab_video_ads]').click();
|
1788 |
+
$('#fv_flowplayer_video_intelligence_revival').show();
|
1789 |
+
});
|
1790 |
+
|
1791 |
+
});
|
1792 |
+
});
|
1793 |
+
</script>
|
1794 |
+
</div>
|
1795 |
+
</div>
|
1796 |
+
</div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
|
1797 |
+
</div>
|
1798 |
+
<div id='postbox-container-tab_help' class='postbox-container' style="">
|
1799 |
+
<div id="normal-sortables" class="meta-box-sortables"><div id="fv_flowplayer_usage" class="postbox " >
|
1800 |
+
<button type="button" class="handlediv" aria-expanded="true"><span class="screen-reader-text">Toggle panel: Usage</span><span class="toggle-indicator" aria-hidden="true"></span></button><h2 class="hndle"><span>Usage</span></h2>
|
1801 |
+
<div class="inside">
|
1802 |
+
<table class="form-table">
|
1803 |
+
<tr>
|
1804 |
+
<td colspan="4">
|
1805 |
+
<div class="column">
|
1806 |
+
<div class="icon32" id="icon-users"><br></div>
|
1807 |
+
<p>Illustrated user guides:</p>
|
1808 |
+
<div class="clear"></div>
|
1809 |
+
<ul>
|
1810 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/start-up-guide#insert-videos">Inserting videos</a>
|
1811 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/start-up-guide">License key and custom logo</a></li>
|
1812 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/creating-playlists">How to create a playlist</a></li>
|
1813 |
+
<li><a target="_blank" href="https://foliovision.com/player/ads">Using ads</a></li>
|
1814 |
+
<li><a target="_blank" href="https://foliovision.com/player/ads/incorporating-google-adsense">Using Google Ads</a></li>
|
1815 |
+
<li><a target="_blank" href="https://foliovision.com/player/video-hosting/securing-your-video/rtmp-streams">RTMP streams</a></li>
|
1816 |
+
<li><a target="_blank" href="https://foliovision.com/player/advanced/subtitles">Subtitles</a></li>
|
1817 |
+
<li><a target="_blank" href="https://foliovision.com/player/video-hosting/secure-amazon-s3-guide">Amazon S3 secure content guide</a></li>
|
1818 |
+
<li><a target="_blank" href="https://foliovision.com/player/video-hosting/securing-your-video/hls-stream">How to setup a HLS stream</a></li>
|
1819 |
+
<li><a target="_blank" href="https://foliovision.com/player/advanced/google-analytics-flowplayer">Google Analytics support</a></li>
|
1820 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/using-lightbox">Video lightbox</a></li>
|
1821 |
+
<li><a target="_blank" href="https://foliovision.com/player/video-hosting/youtube-with-fv-player">YouTube integration</a></li>
|
1822 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/setting-quality-switching">Quality Switching</a></li>
|
1823 |
+
<li><a target="_blank" href="https://foliovision.com/player/video-hosting/how-to-use-vimeo">Vimeo integration</a></li>
|
1824 |
+
<li><a target="_blank" href="https://foliovision.com/player/ads/using-preroll-postroll-ads">Custom video ads</a></li>
|
1825 |
+
<li><a target="_blank" href="https://foliovision.com/player/video-hosting/serving-private-cloudfront">CloudFront CDN - protected video downloads</a></li>
|
1826 |
+
</ul>
|
1827 |
+
</div>
|
1828 |
+
<div class="column">
|
1829 |
+
<div class="icon32" id="icon-tools"><br></div>
|
1830 |
+
<p>Troubleshooting:</p>
|
1831 |
+
<div class="clear"></div>
|
1832 |
+
<ul>
|
1833 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/installation">Automated checks</a></li>
|
1834 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/encoding">Video encoding tips</a></li>
|
1835 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/encoding#flash-only">Video formats to avoid</a></li>
|
1836 |
+
<li><a target="_blank" href="https://foliovision.com/player/video-hosting/secure-amazon-s3-guide/fix-amazon-mime-type">Fixing mime type on Amazon S3</a></li>
|
1837 |
+
<li><a target="_blank" href="https://foliovision.com/player/basic-setup/faq">Plugin FAQ</a></li>
|
1838 |
+
<li><a target="_blank" href="http://foliovision.com/support/fv-wordpress-flowplayer/">Support forums</a></li>
|
1839 |
+
</ul>
|
1840 |
+
</div>
|
1841 |
+
<div class="clear"></div>
|
1842 |
+
<!--<p>
|
1843 |
+
To embed video "example.mp4", simply include the following code inside any post or page:
|
1844 |
+
<code>[fvplayer src=example.mp4]</code>
|
1845 |
+
</p>
|
1846 |
+
<p>
|
1847 |
+
<code>src</code> is the only compulsory parameter, specifying the video file. Its value can be either a full URL of the file,
|
1848 |
+
or just a filename (if it is located in the /videos/ directory in the root of the web).
|
1849 |
+
</p>
|
1850 |
+
<p>When user uploads are allowed, uploading or selecting video from WP Media Library is available. To insert selected video, simply use the 'Insert into Post' button.</p>
|
1851 |
+
<h4>Optional parameters:</h4>
|
1852 |
+
<ul style="text-align: left;">
|
1853 |
+
<li><code><strong>width</strong></code> and <code><strong>height</strong></code> specify the dimensions of played video in pixels. If they are not set, the default size is 320x240.<br />
|
1854 |
+
<i>Example</i>: <code>[fvplayer src='example.mp4' width=640 height=480]</code></li>
|
1855 |
+
<li><code><strong>splash</strong></code> parameter can be used to display a custom splash image before the video starts. Just like in case of <code>src</code>
|
1856 |
+
parameter, its value can be either complete URL, or filename of an image located in /videos/ folder.<br />
|
1857 |
+
<i>Example</i>: <code>[fvplayer src='example.mp4' splash=image.jpg]</code></li>
|
1858 |
+
<li><code><strong>splashend</strong></code> parameter can be used to display a custom splash image after the video ends.<br />
|
1859 |
+
<i>Example</i>: <code>[fvplayer src='example.mp4' splashend=show]</code></li>
|
1860 |
+
<li><code><strong>autoplay</strong></code> parameter specify wheter the video should start to play automaticaly after the page is loaded. This parameter overrides the default autoplay setting above. Its value can be either true or false.<br />
|
1861 |
+
<i>Example</i>: <code>[fvplayer src='example.mp4' autoplay=true]</code></li>
|
1862 |
+
<li><code><strong>loop</strong></code> parameter specify wheter the video starts again from the beginning when the video ends. Its value can be either true or false.<br />
|
1863 |
+
<i>Example</i>: <code>[fvplayer src='example.mp4' loop=true]</code></li>
|
1864 |
+
<li><code><strong>popup</strong></code> parameter can be used to display any HTML code after the video finishes (ideal for advertisment or links to similar videos).
|
1865 |
+
Content you want to display must be between simple quotes (<code>''</code>).<br />
|
1866 |
+
<i>Example</i>: <code>[fvplayer src='example.mp4' popup='<p>some HTML content</p>']</code></li>
|
1867 |
+
<li><code><strong>redirect</strong></code> parameter can be used to redirect to another page (in a new tab) after the video ends.<br />
|
1868 |
+
<i>Example</i>: <code>[fvplayer src='example.mp4' redirect='http://www.site.com']</code></li>
|
1869 |
+
</ul>-->
|
1870 |
+
</td>
|
1871 |
+
<td></td>
|
1872 |
+
</tr>
|
1873 |
+
</table>
|
1874 |
+
</div>
|
1875 |
+
</div>
|
1876 |
+
</div><input type="hidden" id="closedpostboxesnonce" name="closedpostboxesnonce" value="d28516cc79" /><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="3edef551d9" />
|
1877 |
+
</div>
|
1878 |
+
<div style="clear: both"></div>
|
1879 |
+
</div>
|
1880 |
+
<input type="hidden" id="fv_flowplayer_settings_nonce" name="fv_flowplayer_settings_nonce" value="6efb8df58f" /><input type="hidden" name="_wp_http_referer" value="" /> </form>
|
1881 |
+
|
1882 |
+
</div>
|
1883 |
+
<script type="text/javascript" >
|
1884 |
+
function flowplayer_conversion_script() {
|
1885 |
+
jQuery('#fv-flowplayer-loader').show();
|
1886 |
+
|
1887 |
+
var data = {
|
1888 |
+
action: 'flowplayer_conversion_script',
|
1889 |
+
run: true
|
1890 |
+
};
|
1891 |
+
|
1892 |
+
jQuery.post(ajaxurl, data, function(response) {
|
1893 |
+
jQuery('#fv-flowplayer-loader').hide();
|
1894 |
+
jQuery('#conversion-results').html(response);
|
1895 |
+
jQuery('#fvwpflowplayer_conversion_notice').hide();
|
1896 |
+
});
|
1897 |
+
}
|
1898 |
+
|
1899 |
+
function fv_flowplayer_ajax_check( type ) {
|
1900 |
+
jQuery('.'+type+'-spin').show();
|
1901 |
+
var ajaxurl = 'http://example.org/wp-admin/admin-ajax.php';
|
1902 |
+
jQuery.post( ajaxurl, { action: type }, function( response ) {
|
1903 |
+
response = response.replace( /[\s\S]*<FVFLOWPLAYER>/, '' );
|
1904 |
+
response = response.replace( /<\/FVFLOWPLAYER>[\s\S]*/, '' );
|
1905 |
+
try {
|
1906 |
+
var obj = (jQuery.parseJSON( response ) );
|
1907 |
+
var css_class = '';
|
1908 |
+
jQuery('#fv_flowplayer_admin_notices').html('');
|
1909 |
+
if( obj.errors && obj.errors.length > 0 ) {
|
1910 |
+
jQuery('#fv_flowplayer_admin_notices').append( '<div class="error"><p>'+obj.errors.join('</p><p>')+'</p></div>' );
|
1911 |
+
} else {
|
1912 |
+
css_class = ' green';
|
1913 |
+
}
|
1914 |
+
|
1915 |
+
if( obj.ok && obj.ok.length > 0 ) {
|
1916 |
+
jQuery('#fv_flowplayer_admin_notices').append( '<div class="updated'+css_class+'"><p>'+obj.ok.join('</p><p>')+'</p></div>' );
|
1917 |
+
}
|
1918 |
+
|
1919 |
+
} catch(err) {
|
1920 |
+
jQuery('#fv_flowplayer_admin_notices').append( jQuery('#wpbody', response ) );
|
1921 |
+
|
1922 |
+
}
|
1923 |
+
|
1924 |
+
jQuery('.'+type+'-spin').hide();
|
1925 |
+
} );
|
1926 |
+
}
|
1927 |
+
|
1928 |
+
var fv_flowplayer_amazon_s3_count = 0;
|
1929 |
+
jQuery('#amazon-s3-add').click( function() {
|
1930 |
+
var new_inputs = jQuery('tr.amazon-s3-first').clone();
|
1931 |
+
new_inputs.find('input').attr('value','');
|
1932 |
+
new_inputs.attr('class', new_inputs.attr('class') + '-' + fv_flowplayer_amazon_s3_count );
|
1933 |
+
new_inputs.insertBefore('.amazon-s3-last');
|
1934 |
+
fv_flowplayer_amazon_s3_count++;
|
1935 |
+
return false;
|
1936 |
+
} );
|
1937 |
+
|
1938 |
+
function fv_fp_amazon_s3_remove(a) {
|
1939 |
+
jQuery( '.'+jQuery(a).parents('tr').attr('class') ).remove();
|
1940 |
+
}
|
1941 |
+
</script>
|
1942 |
+
|
1943 |
+
|
1944 |
+
<script type="text/javascript">
|
1945 |
+
//<![CDATA[
|
1946 |
+
jQuery(document).ready( function($) {
|
1947 |
+
// close postboxes that should be closed
|
1948 |
+
$('.if-js-closed').removeClass('if-js-closed').addClass('closed');
|
1949 |
+
// postboxes setup
|
1950 |
+
postboxes.add_postbox_toggles('fv_flowplayer_settings');
|
1951 |
+
|
1952 |
+
jQuery('.fv_wp_flowplayer_activate_extension').click( function() { // todo: block multiple clicks
|
1953 |
+
var button = jQuery(this);
|
1954 |
+
button.siblings('img').eq(0).show();
|
1955 |
+
|
1956 |
+
jQuery.post( ajaxurl, { action: 'fv_wp_flowplayer_activate_extension', nonce: 'a3b037f3a9', plugin: jQuery(this).attr("data-plugin") }, function( response ) {
|
1957 |
+
button.siblings('img').eq(0).hide();
|
1958 |
+
|
1959 |
+
var obj;
|
1960 |
+
try {
|
1961 |
+
response = response.replace( /[\s\S]*<FVFLOWPLAYER>/, '' );
|
1962 |
+
response = response.replace( /<\/FVFLOWPLAYER>[\s\S]*/, '' );
|
1963 |
+
obj = jQuery.parseJSON( response );
|
1964 |
+
|
1965 |
+
button.removeClass('fv_wp_flowplayer_activate_extension');
|
1966 |
+
button.attr('value',obj.message);
|
1967 |
+
|
1968 |
+
if( typeof(obj.error) == "undefined" ) {
|
1969 |
+
//window.location.hash = '#'+jQuery(button).attr("data-plugin");
|
1970 |
+
//window.location.reload(true);
|
1971 |
+
window.location.href = window.location.href;
|
1972 |
+
}
|
1973 |
+
} catch(e) { // todo: what if there is "<p>Plugin install failed.</p>"
|
1974 |
+
button.after('<p>Error parsing JSON</p>');
|
1975 |
+
return;
|
1976 |
+
}
|
1977 |
+
|
1978 |
+
} ).error(function() {
|
1979 |
+
button.siblings('img').eq(0).hide();
|
1980 |
+
button.after('<p>Error!</p>');
|
1981 |
+
});
|
1982 |
+
} );
|
1983 |
+
|
1984 |
+
jQuery('.fv-flowplayer-admin-addon-installed').click( function() {
|
1985 |
+
jQuery('html, body').animate({
|
1986 |
+
scrollTop: jQuery("#"+jQuery(this).attr("data-plugin") ).offset().top
|
1987 |
+
}, 1000);
|
1988 |
+
} );
|
1989 |
+
|
1990 |
+
jQuery('.show-more').click( function(e) {
|
1991 |
+
e.preventDefault();
|
1992 |
+
|
1993 |
+
var more = jQuery('.more', jQuery(this).parents('tr') ).length ? jQuery('.more', jQuery(this).parents('tr') ) : jQuery(this).parent().siblings('.more');
|
1994 |
+
|
1995 |
+
more.toggle();
|
1996 |
+
|
1997 |
+
if( jQuery(':visible', more ).length > 0 ) {
|
1998 |
+
jQuery(this).attr('data-original-help-text', jQuery(this).html() );
|
1999 |
+
jQuery(this).html('(hide)');
|
2000 |
+
} else {
|
2001 |
+
jQuery(this).html( jQuery(this).attr('data-original-help-text') );
|
2002 |
+
}
|
2003 |
+
} );
|
2004 |
+
|
2005 |
+
/*
|
2006 |
+
* Coor Picker Default
|
2007 |
+
*/
|
2008 |
+
jQuery('.playlistFontColor-show').click(function(e){
|
2009 |
+
e.preventDefault();
|
2010 |
+
jQuery(e.target).hide();
|
2011 |
+
jQuery('.playlistFontColor-hide').show();
|
2012 |
+
|
2013 |
+
jQuery('#playlistFontColor-proxy').show().val(jQuery('#playlistFontColor-proxy').data('previous'));
|
2014 |
+
jQuery('#playlistFontColor').val(jQuery('#playlistFontColor-proxy').data('previous'));
|
2015 |
+
});
|
2016 |
+
|
2017 |
+
jQuery('.playlistFontColor-hide').click(function(e){
|
2018 |
+
e.preventDefault();
|
2019 |
+
jQuery(e.target).hide();
|
2020 |
+
jQuery('.playlistFontColor-show').show();
|
2021 |
+
|
2022 |
+
jQuery('#playlistFontColor-proxy').data('previous',jQuery('#playlistFontColor-proxy').hide().val()).val('');
|
2023 |
+
jQuery('#playlistFontColor').val('');
|
2024 |
+
});
|
2025 |
+
|
2026 |
+
jQuery('#playlistFontColor-proxy').on('change',function(e){
|
2027 |
+
jQuery('#playlistFontColor').val(jQuery(e.target).val());
|
2028 |
+
});
|
2029 |
+
});
|
2030 |
+
//]]>
|
2031 |
+
</script>
|
2032 |
+
|
2033 |
+
<script>
|
2034 |
+
/* TABS */
|
2035 |
+
jQuery(document).ready(function(){
|
2036 |
+
jQuery('#fv_player_js_warning').hide();
|
2037 |
+
|
2038 |
+
var anchor = window.location.hash.substring(1);
|
2039 |
+
if( !anchor || !anchor.match(/tab_/) ) {
|
2040 |
+
anchor = 'postbox-container-tab_basic';
|
2041 |
+
}
|
2042 |
+
|
2043 |
+
jQuery('#fv_flowplayer_admin_tabs .nav-tab').removeClass('nav-tab-active');
|
2044 |
+
jQuery('[href=#'+anchor+']').addClass('nav-tab-active');
|
2045 |
+
jQuery('#dashboard-widgets .postbox-container').hide();
|
2046 |
+
jQuery('#' + anchor).show();
|
2047 |
+
});
|
2048 |
+
jQuery('#fv_flowplayer_admin_tabs a').on('click',function(e){
|
2049 |
+
e.preventDefault();
|
2050 |
+
window.location.hash = e.target.hash;
|
2051 |
+
var anchor = jQuery(this).attr('href').substring(1);
|
2052 |
+
jQuery('#fv_flowplayer_admin_tabs .nav-tab').removeClass('nav-tab-active');
|
2053 |
+
jQuery('[href=#'+anchor+']').addClass('nav-tab-active');
|
2054 |
+
jQuery('#dashboard-widgets .postbox-container').hide();
|
2055 |
+
jQuery('#' + anchor).show();
|
2056 |
+
});
|
2057 |
+
|
2058 |
+
|
2059 |
+
jQuery('a.fv-settings-anchor').on('click',function(e){
|
2060 |
+
var id = jQuery(this).attr('href');
|
2061 |
+
if( id.match(/^#./) ){
|
2062 |
+
var el = jQuery(id);
|
2063 |
+
if(el.length){
|
2064 |
+
var tab = el.parents('.postbox-container').attr('id');
|
2065 |
+
jQuery('#fv_flowplayer_admin_tabs').find('a[href=#'+tab+']').click()
|
2066 |
+
}
|
2067 |
+
}
|
2068 |
+
});
|
2069 |
+
|
2070 |
+
|
2071 |
+
|
2072 |
+
|
2073 |
+
</script>
|
test/integration/backend/videointelligenceInstallTest.php
ADDED
@@ -0,0 +1,80 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_videointelligenceInstallTestCase extends FV_Player_UnitTestCase {
|
10 |
+
|
11 |
+
var $directory = WP_CONTENT_DIR.'/plugins/fv-player-video-intelligence';
|
12 |
+
|
13 |
+
// we need to convince it is showing the FV Player settings screen!
|
14 |
+
public static function wpSetUpBeforeClass() {
|
15 |
+
set_current_screen( 'settings_page_fvplayer' );
|
16 |
+
|
17 |
+
parent::wpSetUpBeforeClass();
|
18 |
+
|
19 |
+
remove_action( 'admin_init', 'wp_admin_headers' );
|
20 |
+
do_action( 'admin_init' );
|
21 |
+
}
|
22 |
+
|
23 |
+
public function setUp() {
|
24 |
+
parent::setUp();
|
25 |
+
|
26 |
+
// add new user and create last saved position metadata for this new user
|
27 |
+
$this->userID = $this->factory->user->create(array(
|
28 |
+
'role' => 'admin'
|
29 |
+
));
|
30 |
+
|
31 |
+
}
|
32 |
+
|
33 |
+
public function testInstall() {
|
34 |
+
|
35 |
+
$this->assertTrue( defined('FV_PLAYER_VI_USER') && defined('FV_PLAYER_VI_PASS') );
|
36 |
+
|
37 |
+
// we need to submit a valid vi Ads login with an admin user capable of installing plugins
|
38 |
+
global $current_user;
|
39 |
+
wp_set_current_user($this->userID);
|
40 |
+
$current_user->add_cap( 'install_plugins' );
|
41 |
+
|
42 |
+
$_POST['vi_login'] = FV_PLAYER_VI_USER;
|
43 |
+
$_POST['vi_pass'] = FV_PLAYER_VI_PASS;
|
44 |
+
$_POST['fv_player_vi_install'] = true;
|
45 |
+
$_REQUEST['nonce_fv_player_vi_install'] = wp_create_nonce('fv_player_vi_install'); // notice the nonce goes into $_REQUEST
|
46 |
+
|
47 |
+
$this->assertFalse( file_exists($this->directory) );
|
48 |
+
|
49 |
+
do_action( 'admin_menu' );
|
50 |
+
|
51 |
+
$this->assertEquals( "FV Player video intelligence extension installed successfully!", get_option('fv_wordpress_flowplayer_deferred_notices') );
|
52 |
+
|
53 |
+
$this->assertFileExists( $this->directory );
|
54 |
+
|
55 |
+
do_action( 'admin_menu' );
|
56 |
+
|
57 |
+
$this->assertEquals( "FV Player video intelligence extension upgraded successfully!", get_option('fv_wordpress_flowplayer_deferred_notices') );
|
58 |
+
}
|
59 |
+
|
60 |
+
public function tearDown() {
|
61 |
+
unset($_POST['vi_login']);
|
62 |
+
unset($_POST['vi_pass']);
|
63 |
+
unset($_POST['fv_player_vi_install']);
|
64 |
+
unset($_REQUEST['nonce_fv_player_vi_install']);
|
65 |
+
|
66 |
+
if( strlen($this->directory) > 10 ) {
|
67 |
+
$this->removeDirectory($this->directory);
|
68 |
+
}
|
69 |
+
}
|
70 |
+
|
71 |
+
private function removeDirectory($path) {
|
72 |
+
$files = glob($path . '/*');
|
73 |
+
foreach ($files as $file) {
|
74 |
+
is_dir($file) ? $this->removeDirectory($file) : unlink($file);
|
75 |
+
}
|
76 |
+
rmdir($path);
|
77 |
+
return;
|
78 |
+
}
|
79 |
+
|
80 |
+
}
|
test/integration/bootstrap.php
ADDED
@@ -0,0 +1,38 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Bootstrap the plugin unit testing environment.
|
4 |
+
*
|
5 |
+
* Edit 'active_plugins' setting below to point to your main plugin file.
|
6 |
+
*
|
7 |
+
* @package wordpress-plugin-tests
|
8 |
+
*/
|
9 |
+
|
10 |
+
/**
|
11 |
+
* PLEASE NOTE - before this can be used, please checkout the latest WP TestSuite
|
12 |
+
* by using "svn checkout http://develop.svn.wordpress.org/trunk/ testSuite" and rename
|
13 |
+
* files "wp-config-sample.php" and "wp-tests-config-sample.php" by removing the "-sample"
|
14 |
+
* part from it. Then update those files to contain an EMPTY database and login information,
|
15 |
+
* as these tests will create a NEW WP INSTALLATION AND WIPE OUT EVERYTHING THERE IS IN THE DB.
|
16 |
+
*
|
17 |
+
* Also, please make sure to update the value of "WP_PHP_BINARY" constant to point to your PHP binary.
|
18 |
+
*/
|
19 |
+
|
20 |
+
// let whoever is listening know we're in test mode
|
21 |
+
define('PHPUnitTestMode', true);
|
22 |
+
|
23 |
+
// Activates this plugin in WordPress so it can be tested.
|
24 |
+
$GLOBALS['wp_tests_options'] = array(
|
25 |
+
'active_plugins' => array(
|
26 |
+
'fv-wordpress-flowplayer/flowplayer.php',
|
27 |
+
)
|
28 |
+
);
|
29 |
+
|
30 |
+
// If the develop repo location is defined (as WP_DEVELOP_DIR), use that
|
31 |
+
// location. Otherwise, we'll just assume that this plugin is installed in a
|
32 |
+
// WordPress develop SVN checkout.
|
33 |
+
|
34 |
+
if( false !== getenv( 'WP_DEVELOP_DIR' ) ) {
|
35 |
+
require getenv( 'WP_DEVELOP_DIR' ) . '/tests/phpunit/includes/bootstrap.php';
|
36 |
+
} else {
|
37 |
+
require '../testSuite/tests/phpunit/includes/bootstrap.php';
|
38 |
+
}
|
test/integration/frontend/1-shortcodesTest.php
ADDED
@@ -0,0 +1,52 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_ShortcodeTestCase extends FV_Player_UnitTestCase {
|
10 |
+
|
11 |
+
public function setUp() {
|
12 |
+
parent::setUp();
|
13 |
+
|
14 |
+
// create a post with playlist shortcode
|
15 |
+
$this->post_id_SimpleShortcode = $this->factory->post->create( array(
|
16 |
+
'post_title' => 'Simple Shortcode',
|
17 |
+
'post_content' => '[fvplayer src="https://cdn.site.com/video.mp4"]'
|
18 |
+
) );
|
19 |
+
|
20 |
+
/*global $fv_fp;
|
21 |
+
|
22 |
+
include_once "../../../fv-wordpress-flowplayer/models/flowplayer.php";
|
23 |
+
include_once "../../../fv-wordpress-flowplayer/models/flowplayer-frontend.php";
|
24 |
+
$fv_fp = new flowplayer_frontend();
|
25 |
+
|
26 |
+
include_once "../../beta/fv-player-pro.class.php";
|
27 |
+
$this->fvPlayerProInstance = new FV_Player_Pro();*/
|
28 |
+
}
|
29 |
+
|
30 |
+
public function testSimpleShortcode() {
|
31 |
+
global $post;
|
32 |
+
$post = get_post( $this->post_id_SimpleShortcode );
|
33 |
+
$post->ID = 1234;
|
34 |
+
|
35 |
+
remove_action('wp_head', 'wp_generator');
|
36 |
+
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
|
37 |
+
remove_action( 'wp_print_styles', 'print_emoji_styles' );
|
38 |
+
add_filter( 'wp_resource_hints', '__return_empty_array' );
|
39 |
+
|
40 |
+
wp_deregister_script( 'wp-embed' );
|
41 |
+
|
42 |
+
// note that you can only use wp_head() or wp_footer() once!
|
43 |
+
ob_start();
|
44 |
+
wp_head();
|
45 |
+
echo apply_filters( 'the_content', $post->post_content );
|
46 |
+
wp_footer();
|
47 |
+
$output = ob_get_clean();
|
48 |
+
|
49 |
+
$this->assertEquals( $this->fix_newlines(file_get_contents(dirname(__FILE__).'/testSimpleShortcode.html')), $this->fix_newlines($output) );
|
50 |
+
}
|
51 |
+
|
52 |
+
}
|
test/integration/frontend/dbTest.php
ADDED
@@ -0,0 +1,121 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_DBTest extends FV_Player_UnitTestCase {
|
10 |
+
|
11 |
+
public function setUp() {
|
12 |
+
parent::setUp();
|
13 |
+
|
14 |
+
global $FV_Player_Db;
|
15 |
+
$FV_Player_Db->import_player_data( false, false, json_decode( file_get_contents(dirname(__FILE__).'/player-data.json'), true) );
|
16 |
+
|
17 |
+
// create a post with playlist shortcode
|
18 |
+
$this->post_id_testEndActions= $this->factory->post->create( array(
|
19 |
+
'post_title' => 'End Action Test',
|
20 |
+
'post_content' => '[fvplayer src="https://cdn.site.com/video.mp4"]'
|
21 |
+
) );
|
22 |
+
|
23 |
+
// if we don't load something with a [fvplayer] shortcode in it it won't know to load CSS in header!
|
24 |
+
global $post;
|
25 |
+
$post = get_post( $this->post_id_testEndActions );
|
26 |
+
$post->ID = 1234;
|
27 |
+
|
28 |
+
// we remove header stuff which we don't want to test
|
29 |
+
remove_action('wp_head', 'wp_generator');
|
30 |
+
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
|
31 |
+
remove_action( 'wp_print_styles', 'print_emoji_styles' );
|
32 |
+
add_filter( 'wp_resource_hints', '__return_empty_array' );
|
33 |
+
wp_deregister_script( 'wp-embed' );
|
34 |
+
|
35 |
+
}
|
36 |
+
|
37 |
+
public function testDBShortcode() {
|
38 |
+
|
39 |
+
$output = apply_filters( 'the_content', '[fvplayer id="1"]' );
|
40 |
+
|
41 |
+
$sample = <<< HTML
|
42 |
+
<div id="wpfp_034c92b7716ddbcf3a90a3a26440386e" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 100%; background-image: url(https://foliovision.com/video/burning-hula-hoop-girl-dominika.jpg);" data-ratio="0.5625">
|
43 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
44 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
45 |
+
|
46 |
+
</div>
|
47 |
+
<div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_034c92b7716ddbcf3a90a3a26440386e">
|
48 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/dominika-960-31.mp4","type":"video\/mp4"}],"id":1}'><div style='background-image: url("https://foliovision.com/video/burning-hula-hoop-girl-dominika.jpg")'></div><h4><span>Fire</span></h4></a>
|
49 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/Paypal-video-on-home-page.mp4","type":"video\/mp4"}],"id":2,"subtitles":[{"srclang":"en","label":"English","src":"https:\/\/foliovision.com\/videos\/paypal-splash.vtt"}]}'><div style='background-image: url("https://foliovision.com/videos/paypal-splash.jpg")'></div><h4><span>PayPal Background Video</span></h4></a>
|
50 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/Carly-Simon-Anticipation-1971.mp4","type":"video\/mp4"}],"id":3,"subtitles":[{"srclang":"en","label":"English","src":"https:\/\/foliovision.com\/images\/2014\/01\/carly-simon-1971-anticipation.vtt"}]}'><div style='background-image: url("https://foliovision.com/images/2014/01/carly-simon-1971-anticipation.png")'></div><h4><span>Carly Simon</span></h4></a>
|
51 |
+
</div>
|
52 |
+
HTML;
|
53 |
+
|
54 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
55 |
+
}
|
56 |
+
|
57 |
+
public function testDBShortcodeWithSort() {
|
58 |
+
|
59 |
+
$output = apply_filters( 'the_content', '[fvplayer id="1" sort="oldest"]' );
|
60 |
+
|
61 |
+
$sample = <<< HTML
|
62 |
+
<div id="wpfp_034c92b7716ddbcf3a90a3a26440386e" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 100%; background-image: url(https://foliovision.com/video/burning-hula-hoop-girl-dominika.jpg);" data-ratio="0.5625">
|
63 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
64 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
65 |
+
|
66 |
+
</div>
|
67 |
+
<div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_034c92b7716ddbcf3a90a3a26440386e">
|
68 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/dominika-960-31.mp4","type":"video\/mp4"}],"id":1}'><div style='background-image: url("https://foliovision.com/video/burning-hula-hoop-girl-dominika.jpg")'></div><h4><span>Fire</span></h4></a>
|
69 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/Paypal-video-on-home-page.mp4","type":"video\/mp4"}],"id":2,"subtitles":[{"srclang":"en","label":"English","src":"https:\/\/foliovision.com\/videos\/paypal-splash.vtt"}]}'><div style='background-image: url("https://foliovision.com/videos/paypal-splash.jpg")'></div><h4><span>PayPal Background Video</span></h4></a>
|
70 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/Carly-Simon-Anticipation-1971.mp4","type":"video\/mp4"}],"id":3,"subtitles":[{"srclang":"en","label":"English","src":"https:\/\/foliovision.com\/images\/2014\/01\/carly-simon-1971-anticipation.vtt"}]}'><div style='background-image: url("https://foliovision.com/images/2014/01/carly-simon-1971-anticipation.png")'></div><h4><span>Carly Simon</span></h4></a>
|
71 |
+
</div>
|
72 |
+
HTML;
|
73 |
+
|
74 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
75 |
+
|
76 |
+
$output = apply_filters( 'the_content', '[fvplayer id="1" sort="newest"]' );
|
77 |
+
|
78 |
+
$sample = <<< HTML
|
79 |
+
<div id="wpfp_abbc39b8f78820ec7d8d7a8e34d43856" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 100%; background-image: url(https://foliovision.com/images/2014/01/carly-simon-1971-anticipation.png);" data-ratio="0.5625">
|
80 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
81 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
82 |
+
|
83 |
+
</div>
|
84 |
+
<div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_abbc39b8f78820ec7d8d7a8e34d43856">
|
85 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/Carly-Simon-Anticipation-1971.mp4","type":"video\/mp4"}],"subtitles":[{"srclang":"en","label":"English","src":"https:\/\/foliovision.com\/images\/2014\/01\/carly-simon-1971-anticipation.vtt"}]}'><div style='background-image: url("https://foliovision.com/images/2014/01/carly-simon-1971-anticipation.png")'></div><h4><span>Carly Simon</span></h4></a>
|
86 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/Paypal-video-on-home-page.mp4","type":"video\/mp4"}],"subtitles":[{"srclang":"en","label":"English","src":"https:\/\/foliovision.com\/videos\/paypal-splash.vtt"}]}'><div style='background-image: url("https://foliovision.com/videos/paypal-splash.jpg")'></div><h4><span>PayPal Background Video</span></h4></a>
|
87 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/dominika-960-31.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://foliovision.com/video/burning-hula-hoop-girl-dominika.jpg")'></div><h4><span>Fire</span></h4></a>
|
88 |
+
</div>
|
89 |
+
HTML;
|
90 |
+
|
91 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
92 |
+
|
93 |
+
$output = apply_filters( 'the_content', '[fvplayer id="1" sort="title"]' );
|
94 |
+
|
95 |
+
$sample = <<< HTML
|
96 |
+
<div id="wpfp_4836d78a28ea12e5df615a50be31878f" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 100%; background-image: url(https://foliovision.com/images/2014/01/carly-simon-1971-anticipation.png);" data-ratio="0.5625">
|
97 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
98 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
99 |
+
|
100 |
+
</div>
|
101 |
+
<div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_4836d78a28ea12e5df615a50be31878f">
|
102 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/Carly-Simon-Anticipation-1971.mp4","type":"video\/mp4"}],"subtitles":[{"srclang":"en","label":"English","src":"https:\/\/foliovision.com\/images\/2014\/01\/carly-simon-1971-anticipation.vtt"}]}'><div style='background-image: url("https://foliovision.com/images/2014/01/carly-simon-1971-anticipation.png")'></div><h4><span>Carly Simon</span></h4></a>
|
103 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/dominika-960-31.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://foliovision.com/video/burning-hula-hoop-girl-dominika.jpg")'></div><h4><span>Fire</span></h4></a>
|
104 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/foliovision.com\/videos\/Paypal-video-on-home-page.mp4","type":"video\/mp4"}],"subtitles":[{"srclang":"en","label":"English","src":"https:\/\/foliovision.com\/videos\/paypal-splash.vtt"}]}'><div style='background-image: url("https://foliovision.com/videos/paypal-splash.jpg")'></div><h4><span>PayPal Background Video</span></h4></a>
|
105 |
+
</div>
|
106 |
+
HTML;
|
107 |
+
|
108 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
109 |
+
}
|
110 |
+
|
111 |
+
public function testDBExport() {
|
112 |
+
global $FV_Player_Db;
|
113 |
+
$output = json_encode( $FV_Player_Db->export_player_data(false,false,1), JSON_UNESCAPED_SLASHES );
|
114 |
+
$this->assertEquals( file_get_contents(dirname(__FILE__).'/player-data.json'), $output );
|
115 |
+
}
|
116 |
+
|
117 |
+
public function tearDown() {
|
118 |
+
delete_option('fv_player_popups');
|
119 |
+
}
|
120 |
+
|
121 |
+
}
|
test/integration/frontend/endActionsTest.php
ADDED
@@ -0,0 +1,164 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_EndActionsTest extends FV_Player_UnitTestCase {
|
10 |
+
|
11 |
+
public function setUp() {
|
12 |
+
parent::setUp();
|
13 |
+
|
14 |
+
// create a post with playlist shortcode
|
15 |
+
$this->post_id_testEndActions= $this->factory->post->create( array(
|
16 |
+
'post_title' => 'End Action Test',
|
17 |
+
'post_content' => '[fvplayer src="https://cdn.site.com/video.mp4"]'
|
18 |
+
) );
|
19 |
+
|
20 |
+
// if we don't load something with a [fvplayer] shortcode in it it won't know to load CSS in header!
|
21 |
+
global $post;
|
22 |
+
$post = get_post( $this->post_id_testEndActions );
|
23 |
+
$post->ID = 1234;
|
24 |
+
|
25 |
+
// we remove header stuff which we don't want to test
|
26 |
+
remove_action('wp_head', 'wp_generator');
|
27 |
+
remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
|
28 |
+
remove_action( 'wp_print_styles', 'print_emoji_styles' );
|
29 |
+
add_filter( 'wp_resource_hints', '__return_empty_array' );
|
30 |
+
wp_deregister_script( 'wp-embed' );
|
31 |
+
|
32 |
+
// the test data
|
33 |
+
update_option('fv_player_popups', array( 1 => array (
|
34 |
+
'name' => '',
|
35 |
+
'html' => '<a href="https://foliovision.com/2018/07/panamax"><img src="https://cdn.foliovision.com/images/2018/07/PanamaX-5-400x239.jpg" class="alignleft post-image entry-image lazyloaded " alt="PanamaX" itemprop="image" sizes="(max-width: 400px) 100vw, 400px" srcset="https://cdn.foliovision.com/images/2018/07/PanamaX-5-400x239.jpg 400w, https://cdn.foliovision.com/images/2018/07/PanamaX-5.jpg 1128w" width="400" height="239"></a>',
|
36 |
+
'css' => '',
|
37 |
+
'disabled' => '0',
|
38 |
+
) ) );
|
39 |
+
}
|
40 |
+
|
41 |
+
public function testEndActionsEmailCollection() {
|
42 |
+
|
43 |
+
// triggering the default email list creation
|
44 |
+
global $FV_Player_Email_Subscription;
|
45 |
+
$FV_Player_Email_Subscription->init_options();
|
46 |
+
|
47 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video.mp4" share="no" embed="false" popup="email-1"]' );
|
48 |
+
|
49 |
+
$sample = <<< HTML
|
50 |
+
<div id="wpfp_2534ca47632437a90737cb5c0e27b461" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; " data-ratio="0.5625">
|
51 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
52 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
53 |
+
</div>
|
54 |
+
HTML;
|
55 |
+
|
56 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
57 |
+
|
58 |
+
// is the email popup there?
|
59 |
+
wp_deregister_script('flowplayer');
|
60 |
+
flowplayer_prepare_scripts();
|
61 |
+
|
62 |
+
global $wp_scripts;
|
63 |
+
$this->assertTrue( stripos( $this->fix_newlines($wp_scripts->registered['flowplayer']->extra['data']), $this->fix_newlines('var fv_flowplayer_popup = {"wpfp_282c498132552aaa754164072eaaa0d0":{"html":"<div class=\"fv_player_popup fv_player_popup-1 wpfp_custom_popup_content\"><h3>Subscribe to list one<\/h3><p>Two good reasons to subscribe right now<\/p><form class=\"mailchimp-form mailchimp-form-2\"><input type=\"hidden\" name=\"list\" value=\"1\" \/><input type=\"email\" placeholder=\"Email Address\" name=\"email\"\/><input type=\"text\" placeholder=\"First Name\" name=\"first_name\" required\/><input type=\"submit\" value=\"Subscribe\"\/><\/form><\/div>","pause":false}}') ) !== false );
|
64 |
+
|
65 |
+
global $fv_fp;
|
66 |
+
$fv_fp->aPopups = array();
|
67 |
+
}
|
68 |
+
|
69 |
+
public function testEndActionsLoop() {
|
70 |
+
|
71 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video.mp4" share="no" embed="false" loop="true"]' );
|
72 |
+
|
73 |
+
$sample = <<< HTML
|
74 |
+
<div id="wpfp_2534ca47632437a90737cb5c0e27b461" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; " data-ratio="0.5625" data-fv_loop="1">
|
75 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
76 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
77 |
+
</div>
|
78 |
+
HTML;
|
79 |
+
|
80 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
81 |
+
}
|
82 |
+
|
83 |
+
public function testEndActionsPopupNumber() {
|
84 |
+
|
85 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video.mp4" popup="1" share="no" embed="false"]' );
|
86 |
+
|
87 |
+
$sample = <<< HTML
|
88 |
+
<div id="wpfp_2534ca47632437a90737cb5c0e27b461" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; " data-ratio="0.5625">
|
89 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
90 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
91 |
+
</div>
|
92 |
+
HTML;
|
93 |
+
|
94 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
95 |
+
|
96 |
+
// are the popups ready?
|
97 |
+
wp_deregister_script('flowplayer');
|
98 |
+
flowplayer_prepare_scripts();
|
99 |
+
|
100 |
+
global $wp_scripts;
|
101 |
+
$this->assertTrue( stripos( $this->fix_newlines($wp_scripts->registered['flowplayer']->extra['data']), $this->fix_newlines('var fv_flowplayer_popup = {"wpfp_40dd5c9f6426b9d96be06d43e9224af8":{"html":"<div class=\"fv_player_popup fv_player_popup-1 wpfp_custom_popup_content\"><a href=\"https:\/\/foliovision.com\/2018\/07\/panamax\"><img src=\"https:\/\/cdn.foliovision.com\/images\/2018\/07\/PanamaX-5-400x239.jpg\" class=\"alignleft post-image entry-image lazyloaded \" alt=\"PanamaX\" itemprop=\"image\" sizes=\"(max-width: 400px) 100vw, 400px\" srcset=\"https:\/\/cdn.foliovision.com\/images\/2018\/07\/PanamaX-5-400x239.jpg 400w, https:\/\/cdn.foliovision.com\/images\/2018\/07\/PanamaX-5.jpg 1128w\" width=\"400\" height=\"239\"><\/a><\/div>","pause":false}};') ) !== false );
|
102 |
+
|
103 |
+
global $fv_fp;
|
104 |
+
$fv_fp->aPopups = array();
|
105 |
+
}
|
106 |
+
|
107 |
+
public function testEndActionsPopupHTML() {
|
108 |
+
|
109 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video.mp4" share="no" embed="false" popup="'.addslashes('<a href="https://foliovision.com/2018/07/panamax"><img src="https://cdn.foliovision.com/images/2018/07/PanamaX-5-400x239.jpg" class="alignleft post-image entry-image lazyloaded " alt="PanamaX" itemprop="image" sizes="(max-width: 400px) 100vw, 400px" srcset="https://cdn.foliovision.com/images/2018/07/PanamaX-5-400x239.jpg 400w, https://cdn.foliovision.com/images/2018/07/PanamaX-5.jpg 1128w" width="400" height="239"></a>').'"]' );
|
110 |
+
|
111 |
+
$sample = <<< HTML
|
112 |
+
<div id="wpfp_2534ca47632437a90737cb5c0e27b461" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; " data-ratio="0.5625">
|
113 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
114 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
115 |
+
</div>
|
116 |
+
HTML;
|
117 |
+
|
118 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
119 |
+
|
120 |
+
// are the popups ready?
|
121 |
+
wp_deregister_script('flowplayer');
|
122 |
+
flowplayer_prepare_scripts();
|
123 |
+
|
124 |
+
global $wp_scripts;
|
125 |
+
$this->assertTrue( stripos( $this->fix_newlines($wp_scripts->registered['flowplayer']->extra['data']), $this->fix_newlines('var fv_flowplayer_popup = {"wpfp_40dd5c9f6426b9d96be06d43e9224af8":{"html":"<div class=\"fv_player_popup fv_player_popup-1 wpfp_custom_popup_content\"><a href=\"https:\/\/foliovision.com\/2018\/07\/panamax\"><img src=\"https:\/\/cdn.foliovision.com\/images\/2018\/07\/PanamaX-5-400x239.jpg\" class=\"alignleft post-image entry-image lazyloaded \" alt=\"PanamaX\" itemprop=\"image\" sizes=\"(max-width: 400px) 100vw, 400px\" srcset=\"https:\/\/cdn.foliovision.com\/images\/2018\/07\/PanamaX-5-400x239.jpg 400w, https:\/\/cdn.foliovision.com\/images\/2018\/07\/PanamaX-5.jpg 1128w\" width=\"400\" height=\"239\"><\/a><\/div>","pause":false}};') ) !== false );
|
126 |
+
|
127 |
+
global $fv_fp;
|
128 |
+
$fv_fp->aPopups = array();
|
129 |
+
}
|
130 |
+
|
131 |
+
public function testEndActionsRedirect() {
|
132 |
+
|
133 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video.mp4" share="no" embed="false" redirect="https://foliovision.com"]' );
|
134 |
+
|
135 |
+
$sample = <<< HTML
|
136 |
+
<div id="wpfp_2534ca47632437a90737cb5c0e27b461" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; " data-ratio="0.5625" data-fv_redirect="https://foliovision.com">
|
137 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
138 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
139 |
+
</div>
|
140 |
+
HTML;
|
141 |
+
|
142 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
143 |
+
}
|
144 |
+
|
145 |
+
public function testEndActionsSplashEnd() {
|
146 |
+
|
147 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video.mp4" splash="https://cdn.site.com/video.jpg" share="no" embed="false" splashend="show"]' );
|
148 |
+
|
149 |
+
$sample = <<< HTML
|
150 |
+
<div id="wpfp_2534ca47632437a90737cb5c0e27b461" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video.jpg);" data-ratio="0.5625">
|
151 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
152 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
153 |
+
<div id="wpfp_ebf1dd081f973cd9a2b19499445705f2_custom_background" class="wpfp_custom_background" style="position: absolute; background: url('https://cdn.site.com/video.jpg') no-repeat center center; background-size: contain; width: 100%; height: 100%; z-index: 1;"></div>
|
154 |
+
</div>
|
155 |
+
HTML;
|
156 |
+
|
157 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
158 |
+
}
|
159 |
+
|
160 |
+
public function tearDown() {
|
161 |
+
delete_option('fv_player_popups');
|
162 |
+
}
|
163 |
+
|
164 |
+
}
|
test/integration/frontend/player-data.json
ADDED
@@ -0,0 +1 @@
|
|
Â
|
1 |
+
{"ab":"","ad":"","ad_height":"","ad_width":"","ad_skip":"","align":"","autoplay":"","controlbar":"","copy_text":"","embed":"off","end_actions":"","end_action_value":"","height":"","hflip":"","lightbox":"","lightbox_caption":"","lightbox_height":"","lightbox_width":"","player_name":"MP4 Test Playlist","player_slug":"","playlist":"","playlist_advance":"","qsel":"","share":"no","share_title":"","share_url":"","speed":"","sticky":"","video_ads":"","video_ads_post":"","width":"","videos":[{"caption":"Fire","end":"","mobile":"","rtmp":"","rtmp_path":"","splash":"https://foliovision.com/video/burning-hula-hoop-girl-dominika.jpg","splash_text":"","src":"https://foliovision.com/videos/dominika-960-31.mp4","src1":"","src2":"","start":"","meta":[]},{"caption":"PayPal Background Video","end":"","mobile":"","rtmp":"","rtmp_path":"","splash":"https://foliovision.com/videos/paypal-splash.jpg","splash_text":"","src":"https://foliovision.com/videos/Paypal-video-on-home-page.mp4","src1":"","src2":"","start":"","meta":[{"meta_key":"subtitles_en","meta_value":"https://foliovision.com/videos/paypal-splash.vtt"}]},{"caption":"Carly Simon","end":"","mobile":"","rtmp":"","rtmp_path":"","splash":"https://foliovision.com/images/2014/01/carly-simon-1971-anticipation.png","splash_text":"","src":"https://foliovision.com/videos/Carly-Simon-Anticipation-1971.mp4","src1":"","src2":"","start":"","meta":[{"meta_key":"subtitles_en","meta_value":"https://foliovision.com/images/2014/01/carly-simon-1971-anticipation.vtt"}]}]}
|
test/integration/frontend/shortcodesLightboxTest.php
ADDED
@@ -0,0 +1,168 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â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Press integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_ShortcodeLightboxTestCase extends FV_Player_UnitTestCase {
|
10 |
+
|
11 |
+
var $shortcode_body = 'src="https://cdn.site.com/video1.mp4" splash="https://cdn.site.com/video1.jpg" playlist="https://cdn.site.com/video2.mp4,https://cdn.site.com/video2.jpg;https://cdn.site.com/video3.mp4,https://cdn.site.com/video3.jpg" caption="Video 1;Video 2;Video 3" share="no" embed="false"';
|
12 |
+
|
13 |
+
public function testSimple() {
|
14 |
+
|
15 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video1.mp4" splash="https://cdn.site.com/video1.jpg" lightbox="true" share="no" embed="false"]' );
|
16 |
+
|
17 |
+
$sample = <<< HTML
|
18 |
+
<div data-fancybox='gallery' data-options='{"touch":false,"thumb":"https:\/\/cdn.site.com\/video1.jpg"}' id='fv_flowplayer_5d2ac904592b20b5bf87a2a85df7ace7_lightbox_starter' href='#wpfp_5d2ac904592b20b5bf87a2a85df7ace7' class='flowplayer lightbox-starter is-splash no-svg is-paused skin-slim fp-slim fp-edgy' style="max-width: 640px; max-height: 360px; background-image: url('https://cdn.site.com/video1.jpg')" data-ratio="0.5625"><div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div><div class="fp-ratio" style="padding-top: 56.25%"></div></div>
|
19 |
+
<div class='fv_player_lightbox_hidden' style='display: none'>
|
20 |
+
<div id="some-test-hash" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
21 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
22 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
23 |
+
</div>
|
24 |
+
</div>
|
25 |
+
HTML;
|
26 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
27 |
+
}
|
28 |
+
|
29 |
+
|
30 |
+
public function testCaption() {
|
31 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video1.mp4" splash="https://cdn.site.com/video1.jpg" lightbox="true;Video 1" share="no" embed="false"]' );
|
32 |
+
|
33 |
+
$sample = <<< HTML
|
34 |
+
<div data-fancybox='gallery' data-options='{"touch":false,"thumb":"https:\/\/cdn.site.com\/video1.jpg"}' id='fv_flowplayer_5d2ac904592b20b5bf87a2a85df7ace7_lightbox_starter' title='Video 1' href='#wpfp_5d2ac904592b20b5bf87a2a85df7ace7' class='flowplayer lightbox-starter is-splash no-svg is-paused skin-slim fp-slim fp-edgy' style="max-width: 640px; max-height: 360px; background-image: url('https://cdn.site.com/video1.jpg')" data-ratio="0.5625"><div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div><div class="fp-ratio" style="padding-top: 56.25%"></div></div>
|
35 |
+
<div class='fv_player_lightbox_hidden' style='display: none'>
|
36 |
+
<div id="some-test-hash" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
37 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
38 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
39 |
+
</div>
|
40 |
+
</div>
|
41 |
+
HTML;
|
42 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
43 |
+
}
|
44 |
+
|
45 |
+
|
46 |
+
public function testCaptionAndDimensions() {
|
47 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video1.mp4" splash="https://cdn.site.com/video1.jpg" lightbox="true;320;240;Video 1" share="no" embed="false"]' );
|
48 |
+
$sample = <<< HTML
|
49 |
+
<div data-fancybox='gallery' data-options='{"touch":false,"thumb":"https:\/\/cdn.site.com\/video1.jpg"}' id='fv_flowplayer_f1f51bb87ed9702bd91ac63990cee57b_lightbox_starter' title='Video 1' href='#wpfp_f1f51bb87ed9702bd91ac63990cee57b' class='flowplayer lightbox-starter is-splash no-svg is-paused skin-slim fp-slim fp-edgy' style="max-width: 320px; max-height: 240px; background-image: url('https://cdn.site.com/video1.jpg')" data-ratio="0.75"><div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div><div class="fp-ratio" style="padding-top: 75%"></div></div>
|
50 |
+
<div class='fv_player_lightbox_hidden' style='display: none'>
|
51 |
+
<div id="some-test-hash" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
52 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
53 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
54 |
+
</div>
|
55 |
+
</div>
|
56 |
+
HTML;
|
57 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
58 |
+
}
|
59 |
+
|
60 |
+
|
61 |
+
public function testText() {
|
62 |
+
$output = apply_filters( 'the_content', '[fvplayer src="https://cdn.site.com/video1.mp4" splash="https://cdn.site.com/video1.jpg" caption="Video 1" lightbox="true;text" share="no" embed="false"]' );
|
63 |
+
$sample = <<< HTML
|
64 |
+
<a data-fancybox='gallery' data-options='{"touch":false}' id='fv_flowplayer_2f9724515033ace3d660707b426f527c_lightbox_starter' title='Video 1' class='fv-player-lightbox-link' href="#" data-src='#wpfp_2f9724515033ace3d660707b426f527c'>Video 1</a>
|
65 |
+
HTML;
|
66 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
67 |
+
|
68 |
+
|
69 |
+
ob_start();
|
70 |
+
do_action('wp_footer');
|
71 |
+
$footer = ob_get_clean();
|
72 |
+
|
73 |
+
$sample = <<< HTML
|
74 |
+
<div style='display: none'>
|
75 |
+
<div id="wpfp_11361d379334c11f2eaa75f6aacd8386" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy has-caption" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
76 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
77 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
78 |
+
|
79 |
+
</div>
|
80 |
+
<p class='fp-caption'>Video 1</p></div>
|
81 |
+
<!-- lightboxed players -->
|
82 |
+
HTML;
|
83 |
+
|
84 |
+
$this->assertTrue( stripos( $this->fix_newlines($footer),$this->fix_newlines($sample) ) !== false ); // is the lightboxed players in the footer?
|
85 |
+
|
86 |
+
global $FV_Player_lightbox;
|
87 |
+
$this->assertTrue( $FV_Player_lightbox->bLoad ); // is the flag to load lightbox JS set?
|
88 |
+
}
|
89 |
+
|
90 |
+
|
91 |
+
public function testPlaylist() {
|
92 |
+
$output = apply_filters( 'the_content', '[fvplayer '.$this->shortcode_body.' lightbox="true"]' );
|
93 |
+
|
94 |
+
$sample = <<< HTML
|
95 |
+
<div data-fancybox='gallery' data-options='{"touch":false,"thumb":"https:\/\/cdn.site.com\/video1.jpg"}' id='fv_flowplayer_5d2ac904592b20b5bf87a2a85df7ace7_lightbox_starter' href='#wpfp_5d2ac904592b20b5bf87a2a85df7ace7' class='flowplayer lightbox-starter is-splash no-svg is-paused skin-slim fp-slim fp-edgy' style="max-width: 640px; max-height: 360px; background-image: url('https://cdn.site.com/video1.jpg')" data-ratio="0.5625"><div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div><div class="fp-ratio" style="padding-top: 56.25%"></div></div>
|
96 |
+
<div class='fv_player_lightbox_hidden' style='display: none'>
|
97 |
+
<div id="wpfp_5d2ac904592b20b5bf87a2a85df7ace7" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy has-caption" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
98 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
99 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
100 |
+
|
101 |
+
</div>
|
102 |
+
<p class='fp-caption'>Video 1</p></div><div class='fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions'><a id='fv_flowplayer_lightbox_placeholder' href='#' onclick='document.getElementById("fv_flowplayer_5d2ac904592b20b5bf87a2a85df7ace7_lightbox_starter").click(); return false'><div style="background-image: url('https://cdn.site.com/video1.jpg')"></div><h4><span>Video 1</span></h4></a><a data-fancybox='gallery' data-options='{"touch":false,"thumb":"https:\/\/cdn.site.com\/video2.jpg"}' id='fv_flowplayer_lightbox_starter' class='fv-player-lightbox-link' href='#' data-src='#wpfp_e802b17ebbace952275cd50709bf549b'><div style="background-image: url('https://cdn.site.com/video2.jpg')"></div><h4><span>Video 2</span></h4></a><a data-fancybox='gallery' data-options='{"touch":false,"thumb":"https:\/\/cdn.site.com\/video3.jpg"}' id='fv_flowplayer_lightbox_starter' class='fv-player-lightbox-link' href='#' data-src='#wpfp_2ffbd4e84c1ecf2e00db5edf98996de3'><div style="background-image: url('https://cdn.site.com/video3.jpg')"></div><h4><span>Video 3</span></h4></a></div><div class='fv_player_lightbox_hidden' style='display: none'>
|
103 |
+
<div id="wpfp_e802b17ebbace952275cd50709bf549b" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video2.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy has-caption" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video2.jpg);" data-ratio="0.5625">
|
104 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
105 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
106 |
+
|
107 |
+
</div>
|
108 |
+
<p class='fp-caption'>Video 2</p></div><div class='fv_player_lightbox_hidden' style='display: none'>
|
109 |
+
<div id="wpfp_2ffbd4e84c1ecf2e00db5edf98996de3" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video3.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy has-caption" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video3.jpg);" data-ratio="0.5625">
|
110 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
111 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
112 |
+
|
113 |
+
</div>
|
114 |
+
<p class='fp-caption'>Video 3</p></div>
|
115 |
+
HTML;
|
116 |
+
|
117 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
118 |
+
|
119 |
+
// setting liststyle shouldn't affect anything!
|
120 |
+
$output = apply_filters( 'the_content', '[fvplayer '.$this->shortcode_body.' lightbox="true" liststyle="slider"]' );
|
121 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
122 |
+
}
|
123 |
+
|
124 |
+
|
125 |
+
public function testPlaylistText() {
|
126 |
+
$output = apply_filters( 'the_content', '[fvplayer '.$this->shortcode_body.' lightbox="true;text"]' );
|
127 |
+
$sample = <<< HTML
|
128 |
+
<ul><li><a data-fancybox='gallery' data-options='{"touch":false}' id='fv_flowplayer_b721d6e309a0b856f27cc5ffe3f64c19_lightbox_starter' title='Video 1' class='fv-player-lightbox-link' href="#" data-src='#wpfp_b721d6e309a0b856f27cc5ffe3f64c19'>Video 1</a></li><li><a data-fancybox='gallery' data-options='{"touch":false}' id='fv_flowplayer_lightbox_starter' title='Video 2' class='fv-player-lightbox-link' href='#' data-src='#wpfp_f7e1bf7ee8d12a2bf3bc4f148cdd718c'>Video 2</a></li><li><a data-fancybox='gallery' data-options='{"touch":false}' id='fv_flowplayer_lightbox_starter' title='Video 3' class='fv-player-lightbox-link' href='#' data-src='#wpfp_d0ecb746d43cfeca15296bd46c0dee3c'>Video 3</a></li></div></ul>
|
129 |
+
HTML;
|
130 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
131 |
+
|
132 |
+
|
133 |
+
ob_start();
|
134 |
+
do_action('wp_footer');
|
135 |
+
$footer = ob_get_clean();
|
136 |
+
|
137 |
+
$sample = <<< HTML
|
138 |
+
<div style='display: none'>
|
139 |
+
<div id="wpfp_41dd59eae18defa2521bb63946885f69" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy has-caption" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
140 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
141 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
142 |
+
|
143 |
+
</div>
|
144 |
+
<p class='fp-caption'>Video 1</p></div>
|
145 |
+
<div style='display: none'>
|
146 |
+
<div id="wpfp_c189727d02321b2388ebc844c1fdc0c7" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video2.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy has-caption" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video2.jpg);" data-ratio="0.5625">
|
147 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
148 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
149 |
+
|
150 |
+
</div>
|
151 |
+
<p class='fp-caption'>Video 2</p></div>
|
152 |
+
<div style='display: none'>
|
153 |
+
<div id="wpfp_51771d567d4dd88882f65b4b89fc81d6" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video3.mp4","type":"video\/mp4"}]}" class="flowplayer lightboxed no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy has-caption" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video3.jpg);" data-ratio="0.5625">
|
154 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
155 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
156 |
+
|
157 |
+
</div>
|
158 |
+
<p class='fp-caption'>Video 3</p></div>
|
159 |
+
<!-- lightboxed players -->
|
160 |
+
HTML;
|
161 |
+
|
162 |
+
$this->assertTrue( stripos( $this->fix_newlines($footer),$this->fix_newlines($sample) ) !== false ); // are the lightboxed players in the footer?
|
163 |
+
|
164 |
+
global $FV_Player_lightbox;
|
165 |
+
$this->assertTrue( $FV_Player_lightbox->bLoad ); // is the flag to load lightbox JS set?
|
166 |
+
}
|
167 |
+
|
168 |
+
}
|
test/integration/frontend/shortcodesPlaylistTest.php
ADDED
@@ -0,0 +1,156 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|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
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_ShortcodePlaylistTestCase extends FV_Player_UnitTestCase {
|
10 |
+
|
11 |
+
public function setUp() {
|
12 |
+
parent::setUp();
|
13 |
+
|
14 |
+
$shortcode_body = 'src="https://cdn.site.com/video1.mp4" splash="https://cdn.site.com/video1.jpg" playlist="https://cdn.site.com/video2.mp4,https://cdn.site.com/video2.jpg;https://cdn.site.com/video3.mp4,https://cdn.site.com/video3.jpg" caption="Video 1;Video 2; Video 3" share="no" embed="false"';
|
15 |
+
|
16 |
+
// create a post with playlist shortcode
|
17 |
+
$this->playlist_default = $this->factory->post->create( array(
|
18 |
+
'post_content' => '[fvplayer '.$shortcode_body.']'
|
19 |
+
) );
|
20 |
+
|
21 |
+
$this->playlist_vertical = $this->factory->post->create( array(
|
22 |
+
'post_content' => '[fvplayer '.$shortcode_body.' liststyle="vertical"]'
|
23 |
+
) );
|
24 |
+
|
25 |
+
$this->playlist_tabs = $this->factory->post->create( array(
|
26 |
+
'post_content' => '[fvplayer '.$shortcode_body.' liststyle="tabs"]'
|
27 |
+
) );
|
28 |
+
|
29 |
+
$this->playlist_prevnext = $this->factory->post->create( array(
|
30 |
+
'post_content' => '[fvplayer '.$shortcode_body.' liststyle="prevnext"]'
|
31 |
+
) );
|
32 |
+
|
33 |
+
$this->playlist_slider = $this->factory->post->create( array(
|
34 |
+
'post_content' => '[fvplayer '.$shortcode_body.' liststyle="slider"]'
|
35 |
+
) );
|
36 |
+
|
37 |
+
}
|
38 |
+
|
39 |
+
public function testPlaylistStyleShortcode() {
|
40 |
+
global $post;
|
41 |
+
|
42 |
+
$post = get_post( $this->playlist_default );
|
43 |
+
$output = apply_filters( 'the_content', $post->post_content );
|
44 |
+
|
45 |
+
$sample = <<< HTML
|
46 |
+
<div id="wpfp_10ecd1d835d0db002906d6666d27a916" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 100%; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
47 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
48 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
49 |
+
</div>
|
50 |
+
<div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_10ecd1d835d0db002906d6666d27a916">
|
51 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video1.jpg")'></div><h4><span>Video 1</span></h4></a>
|
52 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video2.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video2.jpg")'></div><h4><span>Video 2</span></h4></a>
|
53 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video3.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video3.jpg")'></div><h4><span> Video 3</span></h4></a>
|
54 |
+
</div>
|
55 |
+
HTML;
|
56 |
+
|
57 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
58 |
+
|
59 |
+
|
60 |
+
$post = get_post( $this->playlist_vertical );
|
61 |
+
$output = apply_filters( 'the_content', $post->post_content );
|
62 |
+
|
63 |
+
$sample = <<< HTML
|
64 |
+
<div class="fp-playlist-vertical-wrapper"><div id="wpfp_10ecd1d835d0db002906d6666d27a916" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 100%; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
65 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
66 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
67 |
+
</div>
|
68 |
+
<div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-vertical fp-playlist-has-captions" rel="wpfp_10ecd1d835d0db002906d6666d27a916">
|
69 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video1.jpg")'></div><h4><span>Video 1</span></h4></a>
|
70 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video2.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video2.jpg")'></div><h4><span>Video 2</span></h4></a>
|
71 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video3.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video3.jpg")'></div><h4><span> Video 3</span></h4></a>
|
72 |
+
</div>
|
73 |
+
</div>
|
74 |
+
HTML;
|
75 |
+
|
76 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
77 |
+
|
78 |
+
|
79 |
+
$post = get_post( $this->playlist_prevnext );
|
80 |
+
$output = apply_filters( 'the_content', $post->post_content );
|
81 |
+
|
82 |
+
$sample = <<< HTML
|
83 |
+
<div id="wpfp_10ecd1d835d0db002906d6666d27a916" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 100%; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
84 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
85 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
86 |
+
<a class="fp-prev" title="prev"></a><a class="fp-next" title="next"></a></div>
|
87 |
+
<div style="display: none" class="fp-playlist-external fv-playlist-design-2017 fp-playlist-has-captions" rel="wpfp_10ecd1d835d0db002906d6666d27a916">
|
88 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video1.jpg")'></div><h4><span>Video 1</span></h4></a>
|
89 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video2.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video2.jpg")'></div><h4><span>Video 2</span></h4></a>
|
90 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video3.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video3.jpg")'></div><h4><span> Video 3</span></h4></a>
|
91 |
+
</div>
|
92 |
+
HTML;
|
93 |
+
|
94 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
95 |
+
|
96 |
+
|
97 |
+
$post = get_post( $this->playlist_slider );
|
98 |
+
$output = apply_filters( 'the_content', $post->post_content );
|
99 |
+
|
100 |
+
$sample = <<< HTML
|
101 |
+
<div id="wpfp_10ecd1d835d0db002906d6666d27a916" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 100%; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
102 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
103 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
104 |
+
</div>
|
105 |
+
<div class='fv-playlist-slider-wrapper'><div class="fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal fp-playlist-has-captions" rel="wpfp_10ecd1d835d0db002906d6666d27a916" style="width: 750px">
|
106 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video1.jpg")'></div><h4><span>Video 1</span></h4></a>
|
107 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video2.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video2.jpg")'></div><h4><span>Video 2</span></h4></a>
|
108 |
+
<a href='#' onclick='return false' data-item='{"sources":[{"src":"https:\/\/cdn.site.com\/video3.mp4","type":"video\/mp4"}]}'><div style='background-image: url("https://cdn.site.com/video3.jpg")'></div><h4><span> Video 3</span></h4></a>
|
109 |
+
</div>
|
110 |
+
</div>
|
111 |
+
HTML;
|
112 |
+
|
113 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
114 |
+
}
|
115 |
+
|
116 |
+
public function testPlaylistTabsShortcode() {
|
117 |
+
global $post;
|
118 |
+
|
119 |
+
$post = get_post( $this->playlist_tabs );
|
120 |
+
$output = apply_filters( 'the_content', $post->post_content );
|
121 |
+
|
122 |
+
$sample = <<< HTML
|
123 |
+
<script>document.body.className += " fv_flowplayer_tabs_hide";</script><div class="fv_flowplayer_tabs tabs woocommerce-tabs" style="max-width: 640px"><div id="tabs-10-1" class="fv_flowplayer_tabs_content"><ul><li><a href="#tabs-10-1-0">Video 1</a></li><li><a href="#tabs-10-1-1">Video 2</a></li><li><a href="#tabs-10-1-2"> Video 3</a></li></ul><div class="fv_flowplayer_tabs_cl"></div><div id="tabs-10-1-0" class="fv_flowplayer_tabs_first"><div id="wpfp_5d697f461a6a69e41882ec0212d63d1f" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video1.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video1.jpg);" data-ratio="0.5625">
|
124 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
125 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
126 |
+
|
127 |
+
</div>
|
128 |
+
</div><div id="tabs-10-1-1"><div id="wpfp_f31738e686c3bdae67dfd7e57dec3d8c" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video2.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video2.jpg);" data-ratio="0.5625">
|
129 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
130 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
131 |
+
|
132 |
+
</div>
|
133 |
+
</div><div id="tabs-10-1-2"><div id="wpfp_0dfbb08c099beb557be57907b1c01eb2" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video3.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" data-embed="false" style="max-width: 640px; max-height: 360px; background-image: url(https://cdn.site.com/video3.jpg);" data-ratio="0.5625">
|
134 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
135 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
136 |
+
|
137 |
+
</div>
|
138 |
+
</div><div class="fv_flowplayer_tabs_cl"></div><div class="fv_flowplayer_tabs_cr"></div></div></div>
|
139 |
+
HTML;
|
140 |
+
|
141 |
+
$this->assertEquals( $this->fix_newlines($sample), $this->fix_newlines($output) );
|
142 |
+
|
143 |
+
|
144 |
+
global $fv_fp;
|
145 |
+
$this->assertTrue( $fv_fp->load_tabs );
|
146 |
+
}
|
147 |
+
|
148 |
+
public function tearDown() {
|
149 |
+
global $fv_fp, $FV_Player_lightbox;
|
150 |
+
$fv_fp->load_tabs = false;
|
151 |
+
$FV_Player_lightbox = new FV_Player_lightbox(); // reset the lightbox loading flag and footer lightboxed players HTML
|
152 |
+
|
153 |
+
parent::tearDown();
|
154 |
+
}
|
155 |
+
|
156 |
+
}
|
test/integration/frontend/testSimpleShortcode.html
ADDED
@@ -0,0 +1,83 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<title>Test Blog</title>
|
2 |
+
<link rel='stylesheet' id='fv_flowplayer-css' href='http://example.org/wp-content/plugins/fv-wordpress-flowplayer/css/flowplayer.css?ver=1.2.3' type='text/css' media='all' />
|
3 |
+
<link rel='https://api.w.org/' href='http://example.org/index.php?rest_route=/' />
|
4 |
+
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://example.org/xmlrpc.php?rsd" />
|
5 |
+
<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://example.org/wp-includes/wlwmanifest.xml" />
|
6 |
+
<style type="text/css">.recentcomments a{display:inline !important;padding:0 !important;margin:0 !important;}</style>
|
7 |
+
<style type="text/css">
|
8 |
+
.flowplayer.skin-slim { background-color: #000000 !important; }
|
9 |
+
.flowplayer.skin-slim .fp-color, .flowplayer.skin-slim .fp-selected { background-color: #bb0000 !important; }
|
10 |
+
.flowplayer.skin-slim .fp-color-fill .svg-color, .flowplayer.skin-slim .fp-color-fill svg.fvp-icon, .flowplayer.skin-slim .fp-color-fill { fill: #bb0000 !important; color: #bb0000 !important; }
|
11 |
+
.flowplayer.skin-slim .fp-controls, .fv-player-buttons a:active, .fv-player-buttons a { background-color: transparent !important; }
|
12 |
+
.flowplayer.skin-slim .fp-elapsed, .flowplayer.skin-slim .fp-duration, .flowplayer.skin-slim .noUI-time-in, .flowplayer.skin-slim .noUI-time-out { color: #ffffff !important; }
|
13 |
+
.flowplayer.skin-slim .fv-wp-flowplayer-notice-small { color: #ffffff !important; }
|
14 |
+
.flowplayer.skin-slim .fv-ab-loop .noUi-connect, .fv-player-buttons a.current { background-color: #bb0000 !important; }
|
15 |
+
#content .flowplayer.skin-slim, .flowplayer.skin-slim { font-family: Tahoma, Geneva, sans-serif; }
|
16 |
+
.flowplayer.skin-slim .fp-dropdown li.active { background-color: #bb0000 !important }
|
17 |
+
.flowplayer.skin-youtuby { background-color: #000000 !important; }
|
18 |
+
.flowplayer.skin-youtuby .fp-color, .flowplayer.skin-youtuby .fp-selected { background-color: #bb0000 !important; }
|
19 |
+
.flowplayer.skin-youtuby .fp-color-fill .svg-color, .flowplayer.skin-youtuby .fp-color-fill svg.fvp-icon, .flowplayer.skin-youtuby .fp-color-fill { fill: #bb0000 !important; color: #bb0000 !important; }
|
20 |
+
.flowplayer.skin-youtuby .fp-controls, .fv-player-buttons a:active, .fv-player-buttons a { background-color: rgba(0, 0, 0, 0.5) !important; }
|
21 |
+
.flowplayer.skin-youtuby .fp-elapsed, .flowplayer.skin-youtuby .fp-duration, .flowplayer.skin-youtuby .noUI-time-in, .flowplayer.skin-youtuby .noUI-time-out { color: #ffffff !important; }
|
22 |
+
.flowplayer.skin-youtuby .fv-wp-flowplayer-notice-small { color: #ffffff !important; }
|
23 |
+
.flowplayer.skin-youtuby .fv-ab-loop { background-color: rgba(0, 0, 0, 0.5) !important; }
|
24 |
+
.flowplayer.skin-youtuby .fv-ab-loop .noUi-handle { color: rgba(0, 0, 0, 0.5) !important; }
|
25 |
+
.flowplayer.skin-youtuby .fv_player_popup, .fvfp_admin_error_content { background: rgba(0, 0, 0, 0.5); }
|
26 |
+
.flowplayer.skin-youtuby .fv-ab-loop .noUi-connect, .fv-player-buttons a.current { background-color: #bb0000 !important; }
|
27 |
+
#content .flowplayer.skin-youtuby, .flowplayer.skin-youtuby { font-family: Tahoma, Geneva, sans-serif; }
|
28 |
+
.flowplayer.skin-youtuby .fp-dropdown li.active { background-color: #bb0000 !important }
|
29 |
+
.flowplayer.skin-custom { background-color: #000000 !important; }
|
30 |
+
.flowplayer.skin-custom .fp-color, .flowplayer.skin-custom .fp-selected { background-color: #bb0000 !important; }
|
31 |
+
.flowplayer.skin-custom .fp-color-fill .svg-color, .flowplayer.skin-custom .fp-color-fill svg.fvp-icon, .flowplayer.skin-custom .fp-color-fill { fill: #bb0000 !important; color: #bb0000 !important; }
|
32 |
+
.flowplayer.skin-custom .fp-controls, .fv-player-buttons a:active, .fv-player-buttons a { background-color: #333333 !important; }
|
33 |
+
.flowplayer.skin-custom a.fp-play, .flowplayer.skin-custom a.fp-mute, .flowplayer.skin-custom .fp-controls, .flowplayer.skin-custom .fv-ab-loop, .fv-player-buttons a:active, .fv-player-buttons a { color: #eeeeee !important; }
|
34 |
+
.flowplayer.skin-custom .fv-fp-prevbtn:before, .flowplayer.skin-custom .fv-fp-nextbtn:before { border-color: #eeeeee !important; }
|
35 |
+
.flowplayer.skin-custom .fvfp_admin_error, .flowplayer.skin-custom .fvfp_admin_error a, #content .flowplayer.skin-custom .fvfp_admin_error a { color: #eeeeee; }
|
36 |
+
.flowplayer.skin-custom .fp-volumeslider, .flowplayer.skin-custom .fp-buffer, .flowplayer.skin-custom .noUi-background, .flowplayer.skin-custom .fv-ab-loop .noUi-handle { background-color: #eeeeee !important; }
|
37 |
+
.flowplayer.skin-custom .fp-elapsed, .flowplayer.skin-custom .fp-duration, .flowplayer.skin-custom .noUI-time-in, .flowplayer.skin-custom .noUI-time-out { color: #eeeeee !important; }
|
38 |
+
.flowplayer.skin-custom .fv-wp-flowplayer-notice-small { color: #eeeeee !important; }
|
39 |
+
.flowplayer.skin-custom .fv-ab-loop { background-color: #333333 !important; }
|
40 |
+
.flowplayer.skin-custom .fv-ab-loop .noUi-handle { color: #333333 !important; }
|
41 |
+
.flowplayer.skin-custom .fv_player_popup, .fvfp_admin_error_content { background: #333333; }
|
42 |
+
.flowplayer.skin-custom .fv-ab-loop .noUi-connect, .fv-player-buttons a.current { background-color: #bb0000 !important; }
|
43 |
+
#content .flowplayer.skin-custom, .flowplayer.skin-custom { font-family: Tahoma, Geneva, sans-serif; }
|
44 |
+
.flowplayer.skin-custom .fp-dropdown li.active { background-color: #bb0000 !important }
|
45 |
+
|
46 |
+
.wpfp_custom_background { display: none; }
|
47 |
+
.wpfp_custom_popup { position: absolute; top: 10%; z-index: 20; text-align: center; width: 100%; color: #fff; }
|
48 |
+
.wpfp_custom_popup h1, .wpfp_custom_popup h2, .wpfp_custom_popup h3, .wpfp_custom_popup h4 { color: #fff; }
|
49 |
+
.is-finished .wpfp_custom_background { display: block; }
|
50 |
+
|
51 |
+
.wpfp_custom_ad { position: absolute; bottom: 10%; z-index: 20; width: 100%; }
|
52 |
+
.wpfp_custom_ad_content { background: white; margin: 0 auto; position: relative } .wpfp_custom_ad { color: #888; z-index: 20 !important; }
|
53 |
+
.wpfp_custom_ad a { color: #ff3333 }
|
54 |
+
|
55 |
+
.fp-playlist-external > a > span { background-color:#808080; }
|
56 |
+
.fp-playlist-external > a.is-active > span { border-color:#bb0000; }
|
57 |
+
.fp-playlist-external.fv-playlist-design-2014 a.is-active,.fp-playlist-external.fv-playlist-design-2014 a.is-active h4,.fp-playlist-external.fp-playlist-only-captions a.is-active,.fp-playlist-external.fv-playlist-design-2014 a.is-active h4, .fp-playlist-external.fp-playlist-only-captions a.is-active h4 { color:#bb0000; }
|
58 |
+
.fp-playlist-vertical { background-color:#808080; }
|
59 |
+
.flowplayer .fp-captions p { font-size: 16px; } .flowplayer .fp-logo { bottom: 30px; left: 15px }
|
60 |
+
.flowplayer .fp-captions p { background-color: rgba(0,0,0,0.5) }
|
61 |
+
|
62 |
+
</style>
|
63 |
+
<div id="wpfp_1fd794010fde2df80985efba80286197" data-item="{"sources":[{"src":"https:\/\/cdn.site.com\/video.mp4","type":"video\/mp4"}]}" class="flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy" style="max-width: 640px; max-height: 360px; " data-ratio="0.5625">
|
64 |
+
<div class="fp-ratio" style="padding-top: 56.25%"></div>
|
65 |
+
<div class="fp-ui"><div class="fp-play fp-visible"><a class="fp-icon fp-playbtn"></a></div></div>
|
66 |
+
<div class='fvp-share-bar'><ul class="fvp-sharing">
|
67 |
+
<li><a class="sharing-facebook" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fexample.org%2F%3Fp%3D1234" target="_blank"></a></li>
|
68 |
+
<li><a class="sharing-twitter" href="https://twitter.com/home?status=Test+Blog+http%3A%2F%2Fexample.org%2F%3Fp%3D1234" target="_blank"></a></li>
|
69 |
+
<li><a class="sharing-google" href="https://plus.google.com/share?url=http%3A%2F%2Fexample.org%2F%3Fp%3D1234" target="_blank"></a></li>
|
70 |
+
<li><a class="sharing-email" href="mailto:?body=Check%20out%20the%20amazing%20video%20here%3A%20http%3A%2F%2Fexample.org%2F%3Fp%3D1234" target="_blank"></a></li></ul><div><a class="sharing-link" href="http://example.org/?p=1234" target="_blank">Link</a></div><div><label><a class="embed-code-toggle" href="#"><strong>Embed</strong></a></label></div><div class="embed-code"><label>Copy and paste this HTML code into your webpage to embed.</label><textarea></textarea></div></div>
|
71 |
+
</div>
|
72 |
+
|
73 |
+
<script type='text/javascript' src='http://example.org/wp-includes/js/jquery/jquery.js?ver=1.12.4'></script>
|
74 |
+
<script type='text/javascript' src='http://example.org/wp-includes/js/jquery/jquery-migrate.js?ver=1.4.1'></script>
|
75 |
+
<script type='text/javascript'>
|
76 |
+
/* <![CDATA[ */
|
77 |
+
var fv_flowplayer_conf = {"fullscreen":"1","swf":"\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/flowplayer\/flowplayer.swf?ver=1.2.3","swfHls":"\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/flowplayer\/flowplayerhls.swf?ver=1.2.3","embed":{"library":"\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/flowplayer\/fv-flowplayer.min.js","script":"\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/flowplayer\/embed.min.js","skin":"\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/css\/flowplayer.css","swf":"\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/flowplayer\/flowplayer.swf?ver=1.2.3","swfHls":"\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/flowplayer\/flowplayerhls.swf?ver=1.2.3"},"speeds":[0.25,0.5,0.75,1,1.25,1.5,1.75,2],"video_hash_links":"1","safety_resize":"1","volume":"0.7","sticky_video":"","sticky_place":"right-bottom","sticky_width":"380","script_hls_js":"http:\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/flowplayer\/hls.min.js?ver=1.2.3","script_dash_js":"http:\/\/example.org\/wp-content\/plugins\/fv-wordpress-flowplayer\/flowplayer\/flowplayer.dashjs.min.js?ver=1.2.3","script_dash_js_version":"2.7","hlsjs":{"startLevel":-1,"fragLoadingMaxRetry":3,"levelLoadingMaxRetry":3,"capLevelToPlayerSize":true}};
|
78 |
+
var fv_flowplayer_translations = {"0":"","1":"Video loading aborted","2":"Network error","3":"Video not properly encoded","4":"Video file not found","5":"Unsupported video","6":"Skin not found","7":"SWF file not found","8":"Subtitles not found","9":"Invalid RTMP URL","10":"Unsupported video format. Try installing Adobe Flash.","11":"Click to watch the video","12":"[This post contains video, click to play]","video_expired":"<h2>Video file expired.<br \/>Please reload the page and play it again.<\/h2>","unsupported_format":"<h2>Unsupported video format.<br \/>Please use a Flash compatible device.<\/h2>","mobile_browser_detected_1":"Mobile browser detected, serving low bandwidth video.","mobile_browser_detected_2":"Click here","mobile_browser_detected_3":"for full quality.","live_stream_failed":"<h2>Live stream load failed.<\/h2><h3>Please try again later, perhaps the stream is currently offline.<\/h3>","live_stream_failed_2":"<h2>Live stream load failed.<\/h2><h3>Please try again later, perhaps the stream is currently offline.<\/h3>","what_is_wrong":"Please tell us what is wrong :","full_sentence":"Please give us more information (a full sentence) so we can help you better","error_JSON":"Admin: Error parsing JSON","no_support_IE9":"Admin: Video checker doesn't support IE 9.","check_failed":"Admin: Check failed.","playlist_current":"Now Playing","video_issues":"Video Issues","video_reload":"Video loading has stalled, click to reload","link_copied":"Video Link Copied to Clipboard","embed_copied":"Embed Code Copied to Clipboard","subtitles_disabled":"Subtitles disabled","subtitles_switched":"Subtitles switched to ","warning_iphone_subs":"This video has subtitles, that are not supported on your device.","warning_unstable_android":"You are using an old Android device. If you experience issues with the video please use <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=org.mozilla.firefox\">Firefox<\/a>. <a target=\"_blank\" href=\"https:\/\/foliovision.com\/2017\/05\/issues-with-vimeo-on-android\">Why?<\/a>","warning_samsungbrowser":"You are using the Samsung Browser which is an older and buggy version of Google Chrome. If you experience issues with the video please use <a href=\"https:\/\/www.mozilla.org\/en-US\/firefox\/new\/\">Firefox<\/a> or other modern browser.","warning_old_safari":"You are using an old Safari browser. If you experience issues with the video please use <a href=\"https:\/\/www.mozilla.org\/en-US\/firefox\/new\/\">Firefox<\/a> or other modern browser. <a target=\"_blank\" href=\"https:\/\/foliovision.com\/2017\/05\/issues-with-vimeo-on-android\">Why?<\/a>"};
|
79 |
+
var fv_fp_ajaxurl = "http:\/\/example.org\/wp-admin\/admin-ajax.php";
|
80 |
+
var fv_flowplayer_playlists = [];
|
81 |
+
/* ]]> */
|
82 |
+
</script>
|
83 |
+
<script type='text/javascript' src='http://example.org/wp-content/plugins/fv-wordpress-flowplayer/flowplayer/fv-flowplayer.min.js?ver=1.2.3'></script>
|
test/integration/frontend/videoPositionSavingTest.php
ADDED
@@ -0,0 +1,151 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
require_once( dirname(__FILE__).'/../fv-player-ajax-unittest-case.php');
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Tests WordPress integration of playlists without any advertisements present
|
7 |
+
* in the HTML markup.
|
8 |
+
*/
|
9 |
+
final class FV_Player_videoPositionSavingTestCase extends FV_Player_Ajax_UnitTestCase {
|
10 |
+
|
11 |
+
var $postID = -1;
|
12 |
+
var $userID = -1;
|
13 |
+
|
14 |
+
protected $backupGlobals = false;
|
15 |
+
|
16 |
+
public function setUp() {
|
17 |
+
parent::setUp();
|
18 |
+
|
19 |
+
// create a post with playlist shortcode
|
20 |
+
$this->postID = $this->factory->post->create( array(
|
21 |
+
'post_title' => 'Playlist with Ads',
|
22 |
+
'post_content' => '[fvplayer src="https://cdn.site.com/1.mp4" playlist="https://cdn.site.com/2.mp4;https://cdn.site.com/3.mp4" saveposition="yes"]'
|
23 |
+
) );
|
24 |
+
|
25 |
+
global $fv_fp;
|
26 |
+
|
27 |
+
include_once "../../../fv-wordpress-flowplayer/models/flowplayer.php";
|
28 |
+
include_once "../../../fv-wordpress-flowplayer/models/flowplayer-frontend.php";
|
29 |
+
$fv_fp = new flowplayer_frontend();
|
30 |
+
|
31 |
+
// add new user and create last saved position metadata for this new user
|
32 |
+
$this->userID = $this->factory->user->create(array(
|
33 |
+
'role' => 'admin'
|
34 |
+
));
|
35 |
+
|
36 |
+
/*add_user_meta($this->userID, 'fv_wp_flowplayer_position_watch?v=1XiHhpGUmQg', '12');
|
37 |
+
var_export(get_user_meta($this->userID, 'fv_wp_flowplayer_position_watch?v=1XiHhpGUmQg', true ));*/
|
38 |
+
|
39 |
+
}
|
40 |
+
|
41 |
+
public function testNoSaveForNotLoggedInUsers() {
|
42 |
+
// is anybody listening out there?
|
43 |
+
$this->assertTrue( has_action('wp_ajax_fv_wp_flowplayer_video_position_save') );
|
44 |
+
|
45 |
+
// Spoof the nonce in the POST superglobal
|
46 |
+
//$_POST['_wpnonce'] = wp_create_nonce( 'anything-here-if-needed' );
|
47 |
+
|
48 |
+
// set up POST data for video resume times
|
49 |
+
$_POST['action'] = 'fv_wp_flowplayer_video_position_save';
|
50 |
+
$_POST['videoTimes'] = array(
|
51 |
+
array(
|
52 |
+
'name' => 'https://cdn.site.com/2.mp4',
|
53 |
+
'position' => 12
|
54 |
+
)
|
55 |
+
);
|
56 |
+
|
57 |
+
// call the AJAX which
|
58 |
+
try {
|
59 |
+
$this->_handleAjax( 'fv_wp_flowplayer_video_position_save' );
|
60 |
+
} catch ( WPAjaxDieContinueException $e ) {
|
61 |
+
$response = json_decode( $this->_last_response );
|
62 |
+
$this->assertInternalType( 'object', $response );
|
63 |
+
$this->assertObjectHasAttribute( 'success', $response );
|
64 |
+
$this->assertFalse( $response->success );
|
65 |
+
}
|
66 |
+
|
67 |
+
// check for clear playlist HTML without last player position data items
|
68 |
+
$post = get_post( $this->postID );
|
69 |
+
$output = apply_filters( 'the_content', $post->post_content );
|
70 |
+
|
71 |
+
$expect = "<div id=\"some-test-hash\" class=\"flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy\" style=\"max-width: 100%; \" data-ratio=\"0.5625\" data-save-position=\"yes\">
|
72 |
+
<div class=\"fp-ratio\" style=\"padding-top: 56.25%\"></div>
|
73 |
+
<div class=\"fp-ui\"><div class=\"fp-play fp-visible\"><a class=\"fp-icon fp-playbtn\"></a></div></div>
|
74 |
+
<div class='fvp-share-bar'><ul class=\"fvp-sharing\">
|
75 |
+
<li><a class=\"sharing-facebook\" href=\"https://www.facebook.com/sharer/sharer.php?u=\" target=\"_blank\"></a></li>
|
76 |
+
<li><a class=\"sharing-twitter\" href=\"https://twitter.com/home?status=Test+Blog+\" target=\"_blank\"></a></li>
|
77 |
+
<li><a class=\"sharing-google\" href=\"https://plus.google.com/share?url=\" target=\"_blank\"></a></li>
|
78 |
+
<li><a class=\"sharing-email\" href=\"mailto:?body=Check%20out%20the%20amazing%20video%20here%3A%20\" target=\"_blank\"></a></li></ul><div><label><a class=\"embed-code-toggle\" href=\"#\"><strong>Embed</strong></a></label></div><div class=\"embed-code\"><label>Copy and paste this HTML code into your webpage to embed.</label><textarea></textarea></div></div>
|
79 |
+
</div>
|
80 |
+
<div class=\"fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal\" rel=\"some-test-hash\">
|
81 |
+
<a href='#' onclick='return false' data-item='{\"sources\":[{\"src\":\"https:\/\/cdn.site.com\/1.mp4\",\"type\":\"video\/mp4\"}]}'><div></div></a>
|
82 |
+
<a href='#' onclick='return false' data-item='{\"sources\":[{\"src\":\"https:\/\/cdn.site.com\/2.mp4\",\"type\":\"video\/mp4\"}]}'><div></div></a>
|
83 |
+
<a href='#' onclick='return false' data-item='{\"sources\":[{\"src\":\"https:\/\/cdn.site.com\/3.mp4\",\"type\":\"video\/mp4\"}]}'><div></div></a>
|
84 |
+
</div>
|
85 |
+
|
86 |
+
";
|
87 |
+
|
88 |
+
$this->assertEquals( $this->fix_newlines($expect), $this->fix_newlines($output) );
|
89 |
+
}
|
90 |
+
|
91 |
+
public function testSaveAndPlaylistHTMLForLoggedInUsers() {
|
92 |
+
// is anybody listening out there?
|
93 |
+
$this->assertTrue( has_action('wp_ajax_fv_wp_flowplayer_video_position_save') );
|
94 |
+
|
95 |
+
// Spoof the nonce in the POST superglobal
|
96 |
+
//$_POST['_wpnonce'] = wp_create_nonce( 'anything-here-if-needed' );
|
97 |
+
|
98 |
+
// set this user as the active one
|
99 |
+
global $current_user;
|
100 |
+
$restore_user = $current_user;
|
101 |
+
wp_set_current_user($this->userID);
|
102 |
+
|
103 |
+
// set up POST data for video resume times
|
104 |
+
$_POST['action'] = 'fv_wp_flowplayer_video_position_save';
|
105 |
+
$_POST['videoTimes'] = array(
|
106 |
+
array(
|
107 |
+
'name' => 'https://cdn.site.com/2.mp4',
|
108 |
+
'position' => 12
|
109 |
+
)
|
110 |
+
);
|
111 |
+
|
112 |
+
// call the AJAX which
|
113 |
+
try {
|
114 |
+
$this->_handleAjax( 'fv_wp_flowplayer_video_position_save' );
|
115 |
+
} catch ( WPAjaxDieContinueException $e ) {
|
116 |
+
$response = json_decode( $this->_last_response );
|
117 |
+
$this->assertInternalType( 'object', $response );
|
118 |
+
$this->assertObjectHasAttribute( 'success', $response );
|
119 |
+
$this->assertTrue( $response->success );
|
120 |
+
}
|
121 |
+
|
122 |
+
// check if metadata was saved correctly
|
123 |
+
$this->assertEquals(12, get_user_meta($this->userID, 'fv_wp_flowplayer_position_2', true ));
|
124 |
+
|
125 |
+
// check that the playlist HTML is being generated correctly, with the last player position taken into consideration
|
126 |
+
$post = get_post( $this->postID );
|
127 |
+
$output = apply_filters( 'the_content', $post->post_content );
|
128 |
+
|
129 |
+
$expect = "<div id=\"some-test-hash\" class=\"flowplayer no-brand is-splash no-svg is-paused skin-slim fp-slim fp-edgy\" style=\"max-width: 100%; \" data-ratio=\"0.5625\" data-save-position=\"yes\">
|
130 |
+
<div class=\"fp-ratio\" style=\"padding-top: 56.25%\"></div>
|
131 |
+
<div class=\"fp-ui\"><div class=\"fp-play fp-visible\"><a class=\"fp-icon fp-playbtn\"></a></div></div>
|
132 |
+
<div class='fvp-share-bar'><ul class=\"fvp-sharing\">
|
133 |
+
<li><a class=\"sharing-facebook\" href=\"https://www.facebook.com/sharer/sharer.php?u=\" target=\"_blank\"></a></li>
|
134 |
+
<li><a class=\"sharing-twitter\" href=\"https://twitter.com/home?status=Test+Blog+\" target=\"_blank\"></a></li>
|
135 |
+
<li><a class=\"sharing-google\" href=\"https://plus.google.com/share?url=\" target=\"_blank\"></a></li>
|
136 |
+
<li><a class=\"sharing-email\" href=\"mailto:?body=Check%20out%20the%20amazing%20video%20here%3A%20\" target=\"_blank\"></a></li></ul><div><label><a class=\"embed-code-toggle\" href=\"#\"><strong>Embed</strong></a></label></div><div class=\"embed-code\"><label>Copy and paste this HTML code into your webpage to embed.</label><textarea></textarea></div></div>
|
137 |
+
</div>
|
138 |
+
<div class=\"fp-playlist-external fv-playlist-design-2017 fp-playlist-horizontal\" rel=\"some-test-hash\">
|
139 |
+
<a href='#' onclick='return false' data-item='{\"sources\":[{\"src\":\"https:\/\/cdn.site.com\/1.mp4\",\"type\":\"video\/mp4\"}]}'><div></div></a>
|
140 |
+
<a href='#' onclick='return false' data-item='{\"sources\":[{\"src\":\"https:\/\/cdn.site.com\/2.mp4\",\"type\":\"video\/mp4\",\"position\":\"12\"}]}'><div></div></a>
|
141 |
+
<a href='#' onclick='return false' data-item='{\"sources\":[{\"src\":\"https:\/\/cdn.site.com\/3.mp4\",\"type\":\"video\/mp4\"}]}'><div></div></a>
|
142 |
+
</div>
|
143 |
+
|
144 |
+
";
|
145 |
+
|
146 |
+
$this->assertEquals( $this->fix_newlines($expect), $this->fix_newlines($output) );
|
147 |
+
|
148 |
+
$current_user;
|
149 |
+
}
|
150 |
+
|
151 |
+
}
|
test/integration/fv-player-ajax-unittest-case.php
ADDED
@@ -0,0 +1,67 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class FV_Player_Ajax_UnitTestCase extends WP_Ajax_UnitTestCase {
|
4 |
+
|
5 |
+
protected $backupGlobals = false;
|
6 |
+
|
7 |
+
public function setUp() {
|
8 |
+
parent::setUp();
|
9 |
+
|
10 |
+
global $fv_fp;
|
11 |
+
$this->restore = $fv_fp->conf;
|
12 |
+
|
13 |
+
// somehow this got hooked in again after being removed in WP_Ajax_UnitTestCase::setUpBeforeClass() already
|
14 |
+
remove_action( 'admin_init', '_maybe_update_core' );
|
15 |
+
remove_action( 'admin_init', '_maybe_update_plugins' );
|
16 |
+
remove_action( 'admin_init', '_maybe_update_themes' );
|
17 |
+
}
|
18 |
+
|
19 |
+
public function fix_newlines( $html ) {
|
20 |
+
$html = preg_replace( '/"wpfp_[0-9a-z]+"/', '"some-test-hash"', $html);
|
21 |
+
$html = preg_replace( '~<input type="hidden" id="([^"]*?)nonce" name="([^"]*?)nonce" value="([^"]*?)" />~', '<input type="hidden" id="$1nonce" name="$2nonce" value="XYZ" />', $html);
|
22 |
+
$html = preg_replace( "~nonce: '([^']*?)'~", "nonce: 'XYZ'", $html);
|
23 |
+
|
24 |
+
// testProfileScreen
|
25 |
+
$html = preg_replace( '~fv_ytplayer_[a-z0-9]+~', 'fv_ytplayer_XYZ', $html);
|
26 |
+
$html = preg_replace( '~fv_vimeo_[a-z0-9]+~', 'fv_vimeo_XYZ', $html);
|
27 |
+
$html = preg_replace( '~<input type="hidden" id="fv-player-custom-videos-_fv_player_user_video-0" name="fv-player-custom-videos-_fv_player_user_video-0" value="[^"]*?" />~', '<input type="hidden" id="fv-player-custom-videos-_fv_player_user_video-0" name="fv-player-custom-videos-_fv_player_user_video-0" value="XYZ" />', $html);
|
28 |
+
|
29 |
+
$html = preg_replace( '~convert_jwplayer=[a-z0-9]+~', 'convert_jwplayer=XYZ', $html);
|
30 |
+
$html = preg_replace( '~_wpnonce=[a-z0-9]+~', '_wpnonce=XYZ', $html);
|
31 |
+
|
32 |
+
$html = explode("\n",$html);
|
33 |
+
foreach( $html AS $k => $v ) {
|
34 |
+
if( trim($v) == '' ) unset($html[$k]);
|
35 |
+
}
|
36 |
+
$html = implode( "\n", array_map('trim',$html) );
|
37 |
+
|
38 |
+
$html = preg_replace( '~\t~', '', $html );
|
39 |
+
return $html;
|
40 |
+
}
|
41 |
+
|
42 |
+
// we need to set up PRO player with an appropriate key, or the PRO player won't work
|
43 |
+
public static function wpSetUpBeforeClass() {
|
44 |
+
global $fv_fp;
|
45 |
+
|
46 |
+
// without this included, fv_wp_flowplayer_delete_extensions_transients() would not be found
|
47 |
+
//include_once "../../../fv-wordpress-flowplayer/controller/backend.php";
|
48 |
+
|
49 |
+
// include the flowplayer loader
|
50 |
+
include_once "../../../fv-wordpress-flowplayer/flowplayer.php";
|
51 |
+
|
52 |
+
// include the PRO plugin class, so it can intercept data saving
|
53 |
+
// and update the ads structure as needed for saving
|
54 |
+
//include_once "../../beta/fv-player-pro.class.php";
|
55 |
+
|
56 |
+
// save initial settings
|
57 |
+
//$fv_fp->_set_conf();
|
58 |
+
}
|
59 |
+
|
60 |
+
public function tearDown() {
|
61 |
+
parent::tearDown();
|
62 |
+
|
63 |
+
global $fv_fp;
|
64 |
+
$fv_fp->conf = $this->restore;
|
65 |
+
}
|
66 |
+
|
67 |
+
}
|
test/integration/fv-player-unittest-case.php
ADDED
@@ -0,0 +1,76 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
abstract class FV_Player_UnitTestCase extends WP_UnitTestCase {
|
4 |
+
|
5 |
+
protected $backupGlobals = false;
|
6 |
+
|
7 |
+
public function setUp() {
|
8 |
+
parent::setUp();
|
9 |
+
|
10 |
+
global $fv_fp;
|
11 |
+
$this->restore = $fv_fp->conf;
|
12 |
+
}
|
13 |
+
|
14 |
+
public function fix_newlines( $html ) {
|
15 |
+
$html = preg_replace( '/"wpfp_[0-9a-z]+"/', '"some-test-hash"', $html);
|
16 |
+
$html = preg_replace( '~<input type="hidden" id="([^"]*?)nonce" name="([^"]*?)nonce" value="([^"]*?)" />~', '<input type="hidden" id="$1nonce" name="$2nonce" value="XYZ" />', $html);
|
17 |
+
$html = preg_replace( '~<input type="hidden" id="nonce_([^"]*?)" name="nonce_([^"]*?)" value="([^"]*?)" />~', '<input type="hidden" id="nonce_$1" name="nonce_$2" value="XYZ" />', $html);
|
18 |
+
$html = preg_replace( "~nonce: '([^']*?)'~", "nonce: 'XYZ'", $html);
|
19 |
+
|
20 |
+
// testProfileScreen
|
21 |
+
$html = preg_replace( '~fv_ytplayer_[a-z0-9]+~', 'fv_ytplayer_XYZ', $html);
|
22 |
+
$html = preg_replace( '~fv_vimeo_[a-z0-9]+~', 'fv_vimeo_XYZ', $html);
|
23 |
+
$html = preg_replace( '~<input type="hidden" id="fv-player-custom-videos-_fv_player_user_video-0" name="fv-player-custom-videos-_fv_player_user_video-0" value="[^"]*?" />~', '<input type="hidden" id="fv-player-custom-videos-_fv_player_user_video-0" name="fv-player-custom-videos-_fv_player_user_video-0" value="XYZ" />', $html);
|
24 |
+
|
25 |
+
$html = preg_replace( '~convert_jwplayer=[a-z0-9]+~', 'convert_jwplayer=XYZ', $html);
|
26 |
+
$html = preg_replace( '~_wpnonce=[a-z0-9]+~', '_wpnonce=XYZ', $html);
|
27 |
+
|
28 |
+
$html = explode("\n",$html);
|
29 |
+
foreach( $html AS $k => $v ) {
|
30 |
+
if( trim($v) == '' ) unset($html[$k]);
|
31 |
+
}
|
32 |
+
$html = implode( "\n", array_map('trim',$html) );
|
33 |
+
|
34 |
+
$html = preg_replace( '~\t~', '', $html );
|
35 |
+
|
36 |
+
// playlist in lightbox test
|
37 |
+
$html = preg_replace( "/(href|data-fv-lightbox|data-src)='#wpfp_[^']+'/", "$1='#some-test-hash'", $html);
|
38 |
+
$html = preg_replace( '~fv_flowplayer_[a-z0-9]+_lightbox_starter~', 'fv_flowplayer_XYZ_lightbox_starter', $html);
|
39 |
+
|
40 |
+
// tabbed playlist test
|
41 |
+
$html = preg_replace( '~tabs-\d+~', 'tabs-1', $html);
|
42 |
+
|
43 |
+
// splash end
|
44 |
+
$html = preg_replace( '~wpfp_[a-z0-9]+_custom_background~', 'wpfp_XYZ_custom_background', $html);
|
45 |
+
|
46 |
+
$html = preg_replace( '~\?ver=[0-9\.]+~', '?ver=1.2.3', $html);
|
47 |
+
|
48 |
+
return $html;
|
49 |
+
}
|
50 |
+
|
51 |
+
// we need to set up PRO player with an appropriate key, or the PRO player won't work
|
52 |
+
public static function wpSetUpBeforeClass() {
|
53 |
+
global $fv_fp;
|
54 |
+
|
55 |
+
// without this included, fv_wp_flowplayer_delete_extensions_transients() would not be found
|
56 |
+
//include_once "../../../fv-wordpress-flowplayer/controller/backend.php";
|
57 |
+
|
58 |
+
// include the flowplayer loader
|
59 |
+
include "../../../fv-wordpress-flowplayer/flowplayer.php";
|
60 |
+
|
61 |
+
// include the PRO plugin class, so it can intercept data saving
|
62 |
+
// and update the ads structure as needed for saving
|
63 |
+
//include_once "../../beta/fv-player-pro.class.php";
|
64 |
+
|
65 |
+
// save initial settings
|
66 |
+
//$fv_fp->_set_conf();
|
67 |
+
}
|
68 |
+
|
69 |
+
public function tearDown() {
|
70 |
+
parent::tearDown();
|
71 |
+
|
72 |
+
global $fv_fp;
|
73 |
+
$fv_fp->conf = $this->restore;
|
74 |
+
}
|
75 |
+
|
76 |
+
}
|
test/integration/phpunit.xml
ADDED
@@ -0,0 +1,8 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<phpunit bootstrap="bootstrap.php">
|
2 |
+
<testsuites>
|
3 |
+
<testsuite name="FVPlayer">
|
4 |
+
<directory suffix="Test.php">frontend</directory>
|
5 |
+
<directory suffix="Test.php">backend</directory>
|
6 |
+
</testsuite>
|
7 |
+
</testsuites>
|
8 |
+
</phpunit>
|
test/unit/bootstrap.php
ADDED
@@ -0,0 +1,3 @@
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
include_once('../../vendor/autoload.php');
|
3 |
+
include_once "../wp-global-empty-mocks.php";
|
test/unit/controller/frontendTest.php
ADDED
@@ -0,0 +1,209 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|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
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
use PHPUnit\Framework\TestCase;
|
3 |
+
|
4 |
+
final class FV_Player_Controller extends PHPUnit_Framework_TestCase {
|
5 |
+
|
6 |
+
private $fvPlayerProInstance;
|
7 |
+
|
8 |
+
// playlist items
|
9 |
+
private $playlist_items = array(
|
10 |
+
0 =>
|
11 |
+
array (
|
12 |
+
'sources' =>
|
13 |
+
array (
|
14 |
+
0 =>
|
15 |
+
array (
|
16 |
+
'src' => 'https://youtu.be/7uY0Ab5HlZ0',
|
17 |
+
'type' => 'video/youtube'
|
18 |
+
)
|
19 |
+
)
|
20 |
+
),
|
21 |
+
1 =>
|
22 |
+
array (
|
23 |
+
'sources' =>
|
24 |
+
array (
|
25 |
+
0 =>
|
26 |
+
array (
|
27 |
+
'src' => 'https://www.youtube.com/watch?v=1XiHhpGUmQg',
|
28 |
+
'type' => 'video/youtube'
|
29 |
+
)
|
30 |
+
)
|
31 |
+
),
|
32 |
+
2 =>
|
33 |
+
array (
|
34 |
+
'sources' =>
|
35 |
+
array (
|
36 |
+
0 =>
|
37 |
+
array (
|
38 |
+
'src' => 'https://www.youtube.com/watch?v=Q1eR8pUM5iY',
|
39 |
+
'type' => 'video/youtube'
|
40 |
+
)
|
41 |
+
)
|
42 |
+
)
|
43 |
+
);
|
44 |
+
|
45 |
+
// ads
|
46 |
+
private $adsMock = array(
|
47 |
+
array(
|
48 |
+
'videos' => array(
|
49 |
+
'mp4' => 'https://www.youtube.com/watch?v=tPEE9ZwTmy0'
|
50 |
+
),
|
51 |
+
'disabled' => '0',
|
52 |
+
'name' => 'cat preroll',
|
53 |
+
'click' => 'http://www.pobox.sk'
|
54 |
+
),
|
55 |
+
array(
|
56 |
+
'videos' => array(
|
57 |
+
'mp4' => 'https://www.youtube.com/watch?v=bCGmUCDj4Nc'
|
58 |
+
),
|
59 |
+
'disabled' => '1',
|
60 |
+
'name' => 'kids postroll',
|
61 |
+
'click' => 'http://www.foliovision.com'
|
62 |
+
),
|
63 |
+
array(
|
64 |
+
'videos' => array(
|
65 |
+
'mp4' => 'https://www.youtube.com/watch?v=OsAVRDo9znQ'
|
66 |
+
),
|
67 |
+
'disabled' => '0',
|
68 |
+
'name' => 'funny whatroll',
|
69 |
+
'click' => 'http://www.google.com'
|
70 |
+
)
|
71 |
+
);
|
72 |
+
|
73 |
+
public function setUp() {
|
74 |
+
// set an empty global return value to be used
|
75 |
+
// in all the mocked global WordPress functions
|
76 |
+
// like add_action() and the such
|
77 |
+
global $testReturnValue;
|
78 |
+
$testReturnValue = '';
|
79 |
+
|
80 |
+
include_once "../../models/flowplayer.php";
|
81 |
+
global $fv_fp;
|
82 |
+
$fv_fp = new flowplayer();
|
83 |
+
|
84 |
+
// todo: fix in core perhaps
|
85 |
+
$fv_fp->aAds = array();
|
86 |
+
$fv_fp->aPopups = array();
|
87 |
+
|
88 |
+
include_once "../../controller/frontend.php";
|
89 |
+
}
|
90 |
+
|
91 |
+
public function tearDown() {
|
92 |
+
Mockery::close();
|
93 |
+
}
|
94 |
+
|
95 |
+
public function test_flowplayer_prepare_scripts_js_everywhere() {
|
96 |
+
global $fv_fp;
|
97 |
+
$fv_fp->conf['js-everywhere'] = true;
|
98 |
+
|
99 |
+
ob_start();
|
100 |
+
flowplayer_prepare_scripts();
|
101 |
+
$output = ob_get_clean();
|
102 |
+
|
103 |
+
$expected = "Registering jquery-ui-tabs for ?ver=1.2.3.4 footer? 1
|
104 |
+
Registering fv_flowplayer for fv-wordpress-flowplayer/css/flowplayer.css?ver=1.2.3.4
|
105 |
+
Registering flowplayer for fv-wordpress-flowplayer/flowplayer/fv-flowplayer.min.js?ver=1.2.3.4 footer? 1
|
106 |
+
Registering flowplayer-hlsjs for fv-wordpress-flowplayer/flowplayer/hls.min.js?ver=1.2.3.4 footer? 1
|
107 |
+
Localizing flowplayer with fv_flowplayer_conf = Array
|
108 |
+
(
|
109 |
+
[fullscreen] => 1
|
110 |
+
[swf] => fv-wordpress-flowplayer/flowplayer/flowplayer.swf?ver=1.2.3.4
|
111 |
+
[swfHls] => fv-wordpress-flowplayer/flowplayer/flowplayerhls.swf?ver=1.2.3.4
|
112 |
+
[embed] => Array
|
113 |
+
(
|
114 |
+
[library] => fv-wordpress-flowplayer/flowplayer/fv-flowplayer.min.js
|
115 |
+
[script] => fv-wordpress-flowplayer/flowplayer/embed.min.js
|
116 |
+
[skin] => fv-wordpress-flowplayer/css/flowplayer.css
|
117 |
+
[swf] => fv-wordpress-flowplayer/flowplayer/flowplayer.swf?ver=1.2.3.4
|
118 |
+
[swfHls] => fv-wordpress-flowplayer/flowplayer/flowplayerhls.swf?ver=1.2.3.4
|
119 |
+
)
|
120 |
+
|
121 |
+
[speeds] => Array
|
122 |
+
(
|
123 |
+
[0] => 0.25
|
124 |
+
[1] => 0.5
|
125 |
+
[2] => 0.75
|
126 |
+
[3] => 1
|
127 |
+
[4] => 1.25
|
128 |
+
[5] => 1.5
|
129 |
+
[6] => 1.75
|
130 |
+
[7] => 2
|
131 |
+
)
|
132 |
+
|
133 |
+
[video_hash_links] => 1
|
134 |
+
[safety_resize] => 1
|
135 |
+
[volume] => 0.7
|
136 |
+
[sticky_video] =>
|
137 |
+
[sticky_place] => right-bottom
|
138 |
+
[sticky_width] => 380
|
139 |
+
[script_hls_js] => fv-wordpress-flowplayer/flowplayer/hls.min.js?ver=1.2.3.4
|
140 |
+
[script_dash_js] => fv-wordpress-flowplayer/flowplayer/flowplayer.dashjs.min.js?ver=1.2.3.4
|
141 |
+
[script_dash_js_version] => 2.7
|
142 |
+
[hlsjs] => Array
|
143 |
+
(
|
144 |
+
[startLevel] => -1
|
145 |
+
[fragLoadingMaxRetry] => 3
|
146 |
+
[levelLoadingMaxRetry] => 3
|
147 |
+
[capLevelToPlayerSize] => 1
|
148 |
+
)
|
149 |
+
|
150 |
+
)
|
151 |
+
|
152 |
+
Localizing flowplayer with fv_flowplayer_translations = Array
|
153 |
+
(
|
154 |
+
[0] =>
|
155 |
+
[1] => Video loading aborted
|
156 |
+
[2] => Network error
|
157 |
+
[3] => Video not properly encoded
|
158 |
+
[4] => Video file not found
|
159 |
+
[5] => Unsupported video
|
160 |
+
[6] => Skin not found
|
161 |
+
[7] => SWF file not found
|
162 |
+
[8] => Subtitles not found
|
163 |
+
[9] => Invalid RTMP URL
|
164 |
+
[10] => Unsupported video format. Try installing Adobe Flash.
|
165 |
+
[11] => Click to watch the video
|
166 |
+
[12] => [This post contains video, click to play]
|
167 |
+
[video_expired] => <h2>Video file expired.<br />Please reload the page and play it again.</h2>
|
168 |
+
[unsupported_format] => <h2>Unsupported video format.<br />Please use a Flash compatible device.</h2>
|
169 |
+
[mobile_browser_detected_1] => Mobile browser detected, serving low bandwidth video.
|
170 |
+
[mobile_browser_detected_2] => Click here
|
171 |
+
[mobile_browser_detected_3] => for full quality.
|
172 |
+
[live_stream_failed] => <h2>Live stream load failed.</h2><h3>Please try again later, perhaps the stream is currently offline.</h3>
|
173 |
+
[live_stream_failed_2] => <h2>Live stream load failed.</h2><h3>Please try again later, perhaps the stream is currently offline.</h3>
|
174 |
+
[what_is_wrong] => Please tell us what is wrong :
|
175 |
+
[full_sentence] => Please give us more information (a full sentence) so we can help you better
|
176 |
+
[error_JSON] => Admin: Error parsing JSON
|
177 |
+
[no_support_IE9] => Admin: Video checker doesn't support IE 9.
|
178 |
+
[check_failed] => Admin: Check failed.
|
179 |
+
[playlist_current] => Now Playing
|
180 |
+
[video_issues] => Video Issues
|
181 |
+
[video_reload] => Video loading has stalled, click to reload
|
182 |
+
[link_copied] => Video Link Copied to Clipboard
|
183 |
+
[embed_copied] => Embed Code Copied to Clipboard
|
184 |
+
[subtitles_disabled] => Subtitles disabled
|
185 |
+
[subtitles_switched] => Subtitles switched to
|
186 |
+
[warning_iphone_subs] => This video has subtitles, that are not supported on your device.
|
187 |
+
[warning_unstable_android] => You are using an old Android device. If you experience issues with the video please use <a href=\"https://play.google.com/store/apps/details?id=org.mozilla.firefox\">Firefox</a>. <a target=\"_blank\" href=\"https://foliovision.com/2017/05/issues-with-vimeo-on-android\">Why?</a>
|
188 |
+
[warning_samsungbrowser] => You are using the Samsung Browser which is an older and buggy version of Google Chrome. If you experience issues with the video please use <a href=\"https://www.mozilla.org/en-US/firefox/new/\">Firefox</a> or other modern browser.
|
189 |
+
[warning_old_safari] => You are using an old Safari browser. If you experience issues with the video please use <a href=\"https://www.mozilla.org/en-US/firefox/new/\">Firefox</a> or other modern browser. <a target=\"_blank\" href=\"https://foliovision.com/2017/05/issues-with-vimeo-on-android\">Why?</a>
|
190 |
+
)
|
191 |
+
|
192 |
+
Localizing flowplayer with fv_fp_ajaxurl = https://site.com/wp//wp-admin/admin-ajax.php
|
193 |
+
Localizing flowplayer with fv_flowplayer_playlists = Array
|
194 |
+
(
|
195 |
+
)
|
196 |
+
|
197 |
+
";
|
198 |
+
|
199 |
+
/*$aOut = explode( "\n", preg_replace( '~\r\n~', "\n", $output) );
|
200 |
+
$aExpected = explode( "\n", preg_replace( '~\r\n~', "\n", $expected ) );
|
201 |
+
|
202 |
+
foreach( $aOut AS $k => $v ) {
|
203 |
+
$this->assertEquals( $v, $aExpected[$k] );
|
204 |
+
}*/
|
205 |
+
|
206 |
+
$this->assertEquals( preg_replace( '~\r\n~', "\n", $expected ), preg_replace( '~\r\n~', "\n", $output) );
|
207 |
+
}
|
208 |
+
|
209 |
+
}
|
test/unit/phpunit.xml
ADDED
@@ -0,0 +1,7 @@
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<phpunit bootstrap="bootstrap.php">
|
2 |
+
<testsuites>
|
3 |
+
<testsuite name="controller">
|
4 |
+
<directory suffix="Test.php">controller</directory>
|
5 |
+
</testsuite>
|
6 |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
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
|
Â
|
1 |
+
<?php
|
2 |
+
|
3 |
+
// let whoever is listening know we're in test mode
|
4 |
+
define('PHPUnitTestMode', true);
|
5 |
+
|
6 |
+
// whatever classes we define and mock here, we'll make a list
|
7 |
+
// of these programmatically, so as nobody will forget to add
|
8 |
+
// new classed to the list of mocked ones if it was hard-coded here
|
9 |
+
function file_get_php_classes($filepath) {
|
10 |
+
$php_code = file_get_contents($filepath);
|
11 |
+
$classes = get_php_classes($php_code);
|
12 |
+
return $classes;
|
13 |
+
}
|
14 |
+
|
15 |
+
// complementary function to the one above
|
16 |
+
function get_php_classes($php_code) {
|
17 |
+
$classes = array();
|
18 |
+
$tokens = token_get_all($php_code);
|
19 |
+
$count = count($tokens);
|
20 |
+
for ($i = 2; $i < $count; $i++) {
|
21 |
+
if ( $tokens[$i - 2][0] == T_CLASS
|
22 |
+
&& $tokens[$i - 1][0] == T_WHITESPACE
|
23 |
+
&& $tokens[$i][0] == T_STRING) {
|
24 |
+
|
25 |
+
$class_name = $tokens[$i][1];
|
26 |
+
$classes[] = $class_name;
|
27 |
+
}
|
28 |
+
}
|
29 |
+
return $classes;
|
30 |
+
}
|
31 |
+
|
32 |
+
global $mocked_classes;
|
33 |
+
$mocked_classes = file_get_php_classes(__FILE__);
|
34 |
+
|
35 |
+
function get_calling_class() {
|
36 |
+
global $mocked_classes;
|
37 |
+
|
38 |
+
//get the trace
|
39 |
+
$trace = debug_backtrace();
|
40 |
+
|
41 |
+
// Get the class that is asking for who awoke it
|
42 |
+
// note: edited to say "$trace[3]" instead of "$trace[1]",
|
43 |
+
// since we're additionally going through
|
44 |
+
// get_calling_class() function as well as
|
45 |
+
// the checkAndReturnRequestedValue() function
|
46 |
+
// all the way to the actually mocked global function (add_action())
|
47 |
+
// note2: if we're coming from a class name in this mock file, we should handle that as well
|
48 |
+
|
49 |
+
// we're calling a method of a class in this mock file, handle it as such
|
50 |
+
if (isset($trace[2]['class']) && in_array($trace[2]['class'], $mocked_classes)) {
|
51 |
+
$class = $trace[4]['class'];
|
52 |
+
} else if (isset($trace[3]['class'])){
|
53 |
+
$class = $trace[3]['class'];
|
54 |
+
} else {
|
55 |
+
$class = false;
|
56 |
+
}
|
57 |
+
|
58 |
+
// +1 to i cos we have to account for calling this function
|
59 |
+
for ( $i=1; $i<count( $trace ); $i++ ) {
|
60 |
+
if ( isset( $trace[$i] ) ) { // is it set?
|
61 |
+
if ( isset( $trace[ $i ]['class'] ) && $class != $trace[ $i ]['class'] ) { // is it a different class
|
62 |
+
return $trace[ $i ]['class'];
|
63 |
+
}
|
64 |
+
}
|
65 |
+
}
|
66 |
+
}
|
67 |
+
|
68 |
+
function get_calling_mocked_global_function() {
|
69 |
+
global $mocked_classes;
|
70 |
+
|
71 |
+
$trace = debug_backtrace();
|
72 |
+
// we're calling a method of a class in this mock file, handle it as such
|
73 |
+
if (isset($trace[2]['class']) && in_array($trace[2]['class'], $mocked_classes)) {
|
74 |
+
return $trace[2]['class'].'::'.$trace[2]['function'];
|
75 |
+
} else {
|
76 |
+
return $trace[2]['function'];
|
77 |
+
}
|
78 |
+
}
|
79 |
+
|
80 |
+
function checkAndReturnRequestedValue() {
|
81 |
+
global $mocked_classes;
|
82 |
+
$cclass = get_calling_class();
|
83 |
+
|
84 |
+
// no need to do anything special for non-tested classes,
|
85 |
+
// just return nothing for them
|
86 |
+
// note: we still want to check for return values for methods
|
87 |
+
// called from mocked classes located in this file
|
88 |
+
if (substr($cclass, -4) !== 'Test' && !in_array($cclass, $mocked_classes)) {
|
89 |
+
return;
|
90 |
+
}
|
91 |
+
|
92 |
+
global $testReturnValue;
|
93 |
+
|
94 |
+
// if $testReturnValue is an array, check if we have a return value
|
95 |
+
// at the index of the calling class's function
|
96 |
+
if (is_array($testReturnValue)) {
|
97 |
+
$calling_function = get_calling_mocked_global_function();
|
98 |
+
if (isset($testReturnValue[$calling_function])) {
|
99 |
+
$retValue = $testReturnValue[$calling_function];
|
100 |
+
} else {
|
101 |
+
$retValue = '';
|
102 |
+
}
|
103 |
+
} else {
|
104 |
+
$retValue = $testReturnValue;
|
105 |
+
}
|
106 |
+
|
107 |
+
return $retValue;
|
108 |
+
}
|
109 |
+
|
110 |
+
function add_action() {
|
111 |
+
return checkAndReturnRequestedValue();
|
112 |
+
}
|
113 |
+
|
114 |
+
function add_filter() {
|
115 |
+
return checkAndReturnRequestedValue();
|
116 |
+
}
|
117 |
+
|
118 |
+
function apply_filters( $hook, $value ) {
|
119 |
+
return $value;
|
120 |
+
}
|
121 |
+
|
122 |
+
function current_user_can( $capability ) {
|
123 |
+
return false;
|
124 |
+
}
|
125 |
+
|
126 |
+
function get_option() {
|
127 |
+
return checkAndReturnRequestedValue();
|
128 |
+
}
|
129 |
+
|
130 |
+
function home_url( $url = false ) {
|
131 |
+
return 'https://site.com/'.$url;
|
132 |
+
}
|
133 |
+
|
134 |
+
function is_multisite() {
|
135 |
+
return false;
|
136 |
+
}
|
137 |
+
|
138 |
+
function is_user_logged_in() {
|
139 |
+
return false;
|
140 |
+
}
|
141 |
+
|
142 |
+
function sanitize_title( $title ) {
|
143 |
+
return preg_replace( '~[^a-z0-9_-]~', '-', $title );
|
144 |
+
}
|
145 |
+
|
146 |
+
function site_url( $url = false ) {
|
147 |
+
return 'https://site.com/wp/'.$url;
|
148 |
+
}
|
149 |
+
|
150 |
+
function wp_enqueue_script( $handle, $src = '', $deps = array(), $ver = false, $in_footer ) {
|
151 |
+
echo "Registering $handle for $src?ver=$ver footer? $in_footer\n";
|
152 |
+
}
|
153 |
+
|
154 |
+
function wp_enqueue_style( $handle, $src = '', $deps = array(), $ver = false, $media = 'all' ) {
|
155 |
+
echo "Registering $handle for $src?ver=$ver\n";
|
156 |
+
}
|
157 |
+
|
158 |
+
function wp_localize_script( $handle, $name, $data ) {
|
159 |
+
echo "Localizing $handle with $name = ".print_r($data,true)."\n";
|
160 |
+
}
|
161 |
+
|
162 |
+
function wp_remote_get() {
|
163 |
+
return checkAndReturnRequestedValue();
|
164 |
+
}
|
165 |
+
|
166 |
+
function is_wp_error() {
|
167 |
+
return checkAndReturnRequestedValue();
|
168 |
+
}
|
169 |
+
|
170 |
+
function add_shortcode() {
|
171 |
+
return checkAndReturnRequestedValue();
|
172 |
+
}
|
173 |
+
|
174 |
+
function is_admin() {
|
175 |
+
return checkAndReturnRequestedValue();
|
176 |
+
}
|
177 |
+
|
178 |
+
function plugins_url( $value, $file = false ) {
|
179 |
+
return $value;
|
180 |
+
}
|
181 |
+
|
182 |
+
function update_option() {
|
183 |
+
return checkAndReturnRequestedValue();
|
184 |
+
}
|
185 |
+
|
186 |
+
function wp_parse_args() {
|
187 |
+
return checkAndReturnRequestedValue();
|
188 |
+
}
|
189 |
+
|
190 |
+
function __($txt) {
|
191 |
+
// always return what was given for the translation function
|
192 |
+
return $txt;
|
193 |
+
}
|
194 |
+
|
195 |
+
function _e($txt) {
|
196 |
+
// always echo what was given for the translation function
|
197 |
+
echo $txt;
|
198 |
+
}
|
199 |
+
|
200 |
+
function esc_attr($value) {
|
201 |
+
// always return what was given for the attribute escaping function
|
202 |
+
return $value;
|
203 |
+
}
|
204 |
+
|
205 |
+
// mocks for the WPDB WordPress database manipulation class
|
206 |
+
class wpdb {
|
207 |
+
|
208 |
+
public $prefix = '';
|
209 |
+
|
210 |
+
public function get_charset_collate() {
|
211 |
+
return checkAndReturnRequestedValue();
|
212 |
+
}
|
213 |
+
|
214 |
+
public function query() {
|
215 |
+
return checkAndReturnRequestedValue();
|
216 |
+
}
|
217 |
+
}
|
218 |
+
|
219 |
+
global $wpdb;
|
220 |
+
$wpdb = new wpdb();
|
221 |
+
|
222 |
+
global $fv_wp_flowplayer_ver;
|
223 |
+
$fv_wp_flowplayer_ver = '1.2.3.4';
|
224 |
+
|
225 |
+
define( 'WP_CONTENT_URL', 'https://site.com/wp-content' );
|