All-in-One Video Gallery - Version 2.0.0

Version Description

  • New: Replaced "mediaelement.js" player with the "video.js" player library.
  • Fix: [+] few minor bug fixes.
Download this release

Release Info

Developer plugins360
Plugin Icon 128x128 All-in-One Video Gallery
Version 2.0.0
Comparing to
See all releases

Code changes from version 1.6.9 to 2.0.0

Files changed (115) hide show
  1. README.txt +8 -3
  2. admin/admin.php +2 -2
  3. admin/partials/dashboard.php +33 -33
  4. all-in-one-video-gallery.php +129 -129
  5. freemius/assets/img/all-in-one-video-gallery.png +0 -0
  6. includes/functions.php +87 -37
  7. includes/uninstall.php +84 -84
  8. public/assets/mediaelement/renderers/dailymotion.js +0 -415
  9. public/assets/mediaelement/renderers/dailymotion.min.js +0 -12
  10. public/assets/mediaelement/renderers/facebook.js +0 -361
  11. public/assets/mediaelement/renderers/facebook.min.js +0 -12
  12. public/assets/mediaelement/renderers/vimeo.js +0 -412
  13. public/assets/mediaelement/renderers/vimeo.min.js +0 -12
  14. public/assets/player/can-autoplay/can-autoplay.min.js +23 -0
  15. public/assets/{mediaelement → player}/index.html +0 -0
  16. public/assets/player/videojs-plugins/dailymotion/videojs-dailymotion.min.js +2 -0
  17. public/assets/player/videojs-plugins/facebook/videojs-facebook.min.js +2 -0
  18. public/assets/{mediaelement/renderers → player/videojs-plugins}/index.html +0 -0
  19. public/assets/player/videojs-plugins/overlay/videojs-overlay.css +1 -0
  20. public/assets/player/videojs-plugins/overlay/videojs-overlay.min.js +2 -0
  21. public/assets/player/videojs-plugins/vimeo/videojs-vimeo2.min.js +2 -0
  22. public/assets/player/videojs-plugins/youtube/Youtube.min.js +1 -0
  23. public/assets/player/videojs/font/VideoJS.svg +114 -0
  24. public/assets/player/videojs/font/VideoJS.ttf +0 -0
  25. public/assets/player/videojs/font/VideoJS.woff +0 -0
  26. public/assets/player/videojs/index.html +1 -0
  27. public/assets/player/videojs/lang/ar.js +34 -0
  28. public/assets/player/videojs/lang/ar.json +34 -0
  29. public/assets/player/videojs/lang/ba.js +26 -0
  30. public/assets/player/videojs/lang/ba.json +26 -0
  31. public/assets/player/videojs/lang/bg.js +26 -0
  32. public/assets/player/videojs/lang/bg.json +26 -0
  33. public/assets/player/videojs/lang/ca.js +26 -0
  34. public/assets/player/videojs/lang/ca.json +26 -0
  35. public/assets/player/videojs/lang/cs.js +85 -0
  36. public/assets/player/videojs/lang/cs.json +85 -0
  37. public/assets/player/videojs/lang/cy.js +85 -0
  38. public/assets/player/videojs/lang/cy.json +85 -0
  39. public/assets/player/videojs/lang/da.js +26 -0
  40. public/assets/player/videojs/lang/da.json +26 -0
  41. public/assets/player/videojs/lang/de.js +87 -0
  42. public/assets/player/videojs/lang/de.json +88 -0
  43. public/assets/player/videojs/lang/el.js +40 -0
  44. public/assets/player/videojs/lang/el.json +40 -0
  45. public/assets/player/videojs/lang/en.js +87 -0
  46. public/assets/player/videojs/lang/en.json +87 -0
  47. public/assets/player/videojs/lang/es.js +87 -0
  48. public/assets/player/videojs/lang/es.json +87 -0
  49. public/assets/player/videojs/lang/fa.js +84 -0
  50. public/assets/player/videojs/lang/fa.json +84 -0
  51. public/assets/player/videojs/lang/fi.js +26 -0
  52. public/assets/player/videojs/lang/fi.json +26 -0
  53. public/assets/player/videojs/lang/fr.js +84 -0
  54. public/assets/player/videojs/lang/fr.json +84 -0
  55. public/assets/player/videojs/lang/gd.js +87 -0
  56. public/assets/player/videojs/lang/gd.json +87 -0
  57. public/assets/player/videojs/lang/gl.js +87 -0
  58. public/assets/player/videojs/lang/gl.json +87 -0
  59. public/assets/player/videojs/lang/he.js +84 -0
  60. public/assets/player/videojs/lang/he.json +84 -0
  61. public/assets/player/videojs/lang/hr.js +26 -0
  62. public/assets/player/videojs/lang/hr.json +26 -0
  63. public/assets/player/videojs/lang/hu.js +26 -0
  64. public/assets/player/videojs/lang/hu.json +26 -0
  65. public/assets/player/videojs/lang/it.js +26 -0
  66. public/assets/player/videojs/lang/it.json +26 -0
  67. public/assets/player/videojs/lang/ja.js +26 -0
  68. public/assets/player/videojs/lang/ja.json +26 -0
  69. public/assets/player/videojs/lang/ko.js +26 -0
  70. public/assets/player/videojs/lang/ko.json +26 -0
  71. public/assets/player/videojs/lang/nb.js +26 -0
  72. public/assets/player/videojs/lang/nb.json +26 -0
  73. public/assets/player/videojs/lang/nl.js +84 -0
  74. public/assets/player/videojs/lang/nl.json +84 -0
  75. public/assets/player/videojs/lang/nn.js +26 -0
  76. public/assets/player/videojs/lang/nn.json +26 -0
  77. public/assets/player/videojs/lang/oc.js +87 -0
  78. public/assets/player/videojs/lang/oc.json +87 -0
  79. public/assets/player/videojs/lang/pl.js +34 -0
  80. public/assets/player/videojs/lang/pl.json +34 -0
  81. public/assets/player/videojs/lang/pt-BR.js +85 -0
  82. public/assets/player/videojs/lang/pt-BR.json +86 -0
  83. public/assets/player/videojs/lang/pt-PT.js +41 -0
  84. public/assets/player/videojs/lang/pt-PT.json +41 -0
  85. public/assets/player/videojs/lang/ru.js +85 -0
  86. public/assets/player/videojs/lang/ru.json +85 -0
  87. public/assets/player/videojs/lang/sk.js +85 -0
  88. public/assets/player/videojs/lang/sk.json +85 -0
  89. public/assets/player/videojs/lang/sr.js +26 -0
  90. public/assets/player/videojs/lang/sr.json +26 -0
  91. public/assets/player/videojs/lang/sv.js +87 -0
  92. public/assets/player/videojs/lang/sv.json +87 -0
  93. public/assets/player/videojs/lang/tr.js +76 -0
  94. public/assets/player/videojs/lang/tr.json +76 -0
  95. public/assets/player/videojs/lang/uk.js +85 -0
  96. public/assets/player/videojs/lang/uk.json +85 -0
  97. public/assets/player/videojs/lang/vi.js +84 -0
  98. public/assets/player/videojs/lang/vi.json +84 -0
  99. public/assets/player/videojs/lang/zh-CN.js +87 -0
  100. public/assets/player/videojs/lang/zh-CN.json +87 -0
  101. public/assets/player/videojs/lang/zh-Hans.js +87 -0
  102. public/assets/player/videojs/lang/zh-Hans.json +87 -0
  103. public/assets/player/videojs/lang/zh-Hant.js +87 -0
  104. public/assets/player/videojs/lang/zh-Hant.json +87 -0
  105. public/assets/player/videojs/lang/zh-TW.js +87 -0
  106. public/assets/player/videojs/lang/zh-TW.json +87 -0
  107. public/assets/player/videojs/video-js.min.css +1 -0
  108. public/assets/player/videojs/video.min.js +21 -0
  109. public/templates/player-amp.php +258 -0
  110. public/templates/player-gdpr.php +3 -1
  111. public/templates/player-html5.php +387 -417
  112. public/templates/player-iframe.php +3 -1
  113. public/templates/player.php +1 -1
  114. public/video.php +4 -0
  115. public/videos.php +7 -0
README.txt CHANGED
@@ -6,7 +6,7 @@ Tags: video player, video gallery, youtube gallery, vimeo gallery, livestream
6
Requires at least: 4.7.0
7
Tested up to: 5.3
8
Requires PHP: 5.3.0
9
- Stable tag: 1.6.9
10
License: GPLv2 or later
11
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
@@ -110,6 +110,11 @@ Please describe your issue and submit a ticket on our plugin support forum, you
110
111
== Changelog ==
112
113
= 1.6.9 =
114
115
* Tweak: "Autoplay" disabled in the default plugin settings since the browsers don't like this option.
@@ -251,6 +256,6 @@ Please describe your issue and submit a ticket on our plugin support forum, you
251
252
== Upgrade Notice ==
253
254
- = 1.6.9 =
255
256
- Private Vimeo videos not working when configured to "Use Native Controls". "Autoplay" disabled in the default plugin settings since the browsers don't like this option.
6
Requires at least: 4.7.0
7
Tested up to: 5.3
8
Requires PHP: 5.3.0
9
+ Stable tag: 2.0.0
10
License: GPLv2 or later
11
License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
110
111
== Changelog ==
112
113
+ = 2.0.0 =
114
+
115
+ * New: Replaced "mediaelement.js" player with the "video.js" player library.
116
+ * Fix: [+] few minor bug fixes.
117
+
118
= 1.6.9 =
119
120
* Tweak: "Autoplay" disabled in the default plugin settings since the browsers don't like this option.
256
257
== Upgrade Notice ==
258
259
+ = 2.0.0 =
260
261
+ Introduces several bug fixes, new features & enhancements. [See changelog](https://wordpress.org/plugins/all-in-one-video-gallery/#developers)
admin/admin.php CHANGED
@@ -327,10 +327,10 @@ class AIOVG_Admin {
327
328
$page_settings = get_option( 'aiovg_page_settings' );
329
330
- $pages = aiovg_get_custom_pages_list();
331
- $issue_found = 0;
332
333
foreach ( $pages as $key => $page ) {
334
$post_id = $page_settings[ $key ];
335
336
if ( $post_id > 0 ) {
327
328
$page_settings = get_option( 'aiovg_page_settings' );
329
330
+ $pages = aiovg_get_custom_pages_list();
331
332
foreach ( $pages as $key => $page ) {
333
+ $issue_found = 0;
334
$post_id = $page_settings[ $key ];
335
336
if ( $post_id > 0 ) {
admin/partials/dashboard.php CHANGED
@@ -1,5 +1,5 @@
1
- <?php
2
-
3
/**
4
* Plugin Dashboard.
5
*
@@ -7,49 +7,49 @@
7
* @since 1.6.5
8
*
9
* @package All_In_One_Video_Gallery
10
- */
11
- ?>
12
13
<div id="aiovg-dashboard" class="wrap about-wrap full-width-layout aiovg-dashboard">
14
- <h1><?php
15
- esc_html_e( 'All-in-One Video Gallery', 'all-in-one-video-gallery' );
16
?></h1>
17
18
<p class="about-text">
19
- <?php
20
- esc_html_e( 'Add responsive video galleries anywhere on your website – no coding required. Includes HTML5 Player, Thumbnail Grid, Slider, Popup & more.', 'all-in-one-video-gallery' );
21
- ?>
22
</p>
23
24
- <?php
25
- ?>
26
27
- <div class="wp-badge aiovg-badge"><?php
28
- printf( esc_html__( 'Version %s', 'all-in-one-video-gallery' ), AIOVG_PLUGIN_VERSION );
29
?></div>
30
31
<h2 class="nav-tab-wrapper wp-clearfix">
32
- <?php
33
- foreach ( $tabs as $tab => $title ) {
34
- $url = admin_url( add_query_arg( 'tab', $tab, 'admin.php?page=all-in-one-video-gallery' ) );
35
- $class = ( $tab == $active_tab ? 'nav-tab nav-tab-active' : 'nav-tab' );
36
-
37
- if ( 'issues' == $tab ) {
38
- $class .= ' aiovg-text-error';
39
- $title .= sprintf( ' <span class="count">(%d)</span>', count( $issues['found'] ) );
40
- }
41
-
42
- printf(
43
- '<a href="%s" class="%s">%s</a>',
44
- esc_url( $url ),
45
- $class,
46
- $title
47
- );
48
- }
49
- ?>
50
</h2>
51
52
- <?php
53
- require_once AIOVG_PLUGIN_DIR . "admin/partials/{$active_tab}.php";
54
?>
55
</div>
1
+ <?php
2
+
3
/**
4
* Plugin Dashboard.
5
*
7
* @since 1.6.5
8
*
9
* @package All_In_One_Video_Gallery
10
+ */
11
+ ?>
12
13
<div id="aiovg-dashboard" class="wrap about-wrap full-width-layout aiovg-dashboard">
14
+ <h1><?php
15
+ esc_html_e( 'All-in-One Video Gallery', 'all-in-one-video-gallery' );
16
?></h1>
17
18
<p class="about-text">
19
+ <?php
20
+ esc_html_e( 'Add responsive video galleries anywhere on your website – no coding required. Includes HTML5 Player, Thumbnail Grid, Slider, Popup & more.', 'all-in-one-video-gallery' );
21
+ ?>
22
</p>
23
24
+ <?php
25
+ ?>
26
27
+ <div class="wp-badge aiovg-badge"><?php
28
+ printf( esc_html__( 'Version %s', 'all-in-one-video-gallery' ), AIOVG_PLUGIN_VERSION );
29
?></div>
30
31
<h2 class="nav-tab-wrapper wp-clearfix">
32
+ <?php
33
+ foreach ( $tabs as $tab => $title ) {
34
+ $url = admin_url( add_query_arg( 'tab', $tab, 'admin.php?page=all-in-one-video-gallery' ) );
35
+ $class = ( $tab == $active_tab ? 'nav-tab nav-tab-active' : 'nav-tab' );
36
+
37
+ if ( 'issues' == $tab ) {
38
+ $class .= ' aiovg-text-error';
39
+ $title .= sprintf( ' <span class="count">(%d)</span>', count( $issues['found'] ) );
40
+ }
41
+
42
+ printf(
43
+ '<a href="%s" class="%s">%s</a>',
44
+ esc_url( $url ),
45
+ $class,
46
+ $title
47
+ );
48
+ }
49
+ ?>
50
</h2>
51
52
+ <?php
53
+ require_once AIOVG_PLUGIN_DIR . "admin/partials/{$active_tab}.php";
54
?>
55
</div>
all-in-one-video-gallery.php CHANGED
@@ -1,5 +1,5 @@
1
- <?php
2
-
3
/**
4
* The plugin bootstrap file.
5
*
@@ -11,149 +11,149 @@
11
* Plugin Name: All-in-One Video Gallery
12
* Plugin URI: https://plugins360.com/all-in-one-video-gallery/
13
* Description: No coding required. A Responsive & Lightweight video gallery plugin. HTML5 Player, Categories, Visual Builder (Gutenberg), Search Form, Comments, Social Sharing and everything you will need to build a YouTube/Vimeo like video sharing website.
14
- * Version: 1.6.9
15
* Author: Team Plugins360
16
* Author URI: https://plugins360.com
17
* License: GPL-2.0+
18
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
19
* Text Domain: all-in-one-video-gallery
20
* Domain Path: /languages
21
- *
22
- */
23
- // Exit if accessed directly
24
- if ( !defined( 'WPINC' ) ) {
25
- die;
26
- }
27
-
28
- if ( function_exists( 'aiovg_fs' ) ) {
29
- aiovg_fs()->set_basename( false, __FILE__ );
30
- return;
31
- }
32
-
33
-
34
- if ( !function_exists( 'aiovg_fs' ) ) {
35
- // Create a helper function for easy SDK access
36
- function aiovg_fs()
37
- {
38
- global $aiovg_fs ;
39
-
40
- if ( !isset( $aiovg_fs ) ) {
41
- // Activate multisite network integration
42
- if ( !defined( 'WP_FS__PRODUCT_3213_MULTISITE' ) ) {
43
- define( 'WP_FS__PRODUCT_3213_MULTISITE', true );
44
- }
45
- // Include Freemius SDK
46
- require_once dirname( __FILE__ ) . '/freemius/start.php';
47
- $aiovg_fs = fs_dynamic_init( array(
48
- 'id' => '3213',
49
- 'slug' => 'all-in-one-video-gallery',
50
- 'type' => 'plugin',
51
- 'public_key' => 'pk_e1bed9a9a8957abe8947bb2619ab7',
52
- 'is_premium' => false,
53
- 'has_addons' => false,
54
- 'has_paid_plans' => true,
55
- 'trial' => array(
56
- 'days' => 7,
57
- 'is_require_payment' => false,
58
- ),
59
- 'menu' => array(
60
- 'slug' => 'all-in-one-video-gallery',
61
- 'first-path' => 'admin.php?page=all-in-one-video-gallery',
62
- 'support' => false,
63
- ),
64
- 'is_live' => true,
65
- ) );
66
- }
67
-
68
- return $aiovg_fs;
69
- }
70
-
71
- // Init Freemius
72
- aiovg_fs();
73
- // Signal that SDK was initiated
74
- do_action( 'aiovg_fs_loaded' );
75
- }
76
-
77
- // The current version of the plugin
78
- if ( !defined( 'AIOVG_PLUGIN_VERSION' ) ) {
79
- define( 'AIOVG_PLUGIN_VERSION', '1.6.9' );
80
- }
81
- // The unique identifier of the plugin
82
- if ( !defined( 'AIOVG_PLUGIN_SLUG' ) ) {
83
- define( 'AIOVG_PLUGIN_SLUG', 'all-in-one-video-gallery' );
84
- }
85
- // Path to the plugin directory
86
- if ( !defined( 'AIOVG_PLUGIN_DIR' ) ) {
87
- define( 'AIOVG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
88
- }
89
- // URL of the plugin
90
- if ( !defined( 'AIOVG_PLUGIN_URL' ) ) {
91
- define( 'AIOVG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
92
- }
93
- // The plugin file name
94
- if ( !defined( 'AIOVG_PLUGIN_FILE_NAME' ) ) {
95
- define( 'AIOVG_PLUGIN_FILE_NAME', plugin_basename( __FILE__ ) );
96
- }
97
- // The global plugin variable
98
- $aiovg = array();
99
-
100
- if ( !function_exists( 'aiovg_activate' ) ) {
101
/**
102
* The code that runs during plugin activation.
103
* This action is documented in includes/activator.php
104
- */
105
- function aiovg_activate()
106
- {
107
- require_once AIOVG_PLUGIN_DIR . 'includes/activator.php';
108
- AIOVG_Activator::activate();
109
- }
110
-
111
- register_activation_hook( __FILE__, 'aiovg_activate' );
112
- }
113
-
114
-
115
- if ( !function_exists( 'aiovg_deactivate' ) ) {
116
/**
117
* The code that runs during plugin deactivation.
118
* This action is documented in includes/deactivator.php
119
- */
120
- function aiovg_deactivate()
121
- {
122
- require_once AIOVG_PLUGIN_DIR . 'includes/deactivator.php';
123
- AIOVG_Deactivator::deactivate();
124
- }
125
-
126
- register_deactivation_hook( __FILE__, 'aiovg_deactivate' );
127
- }
128
-
129
-
130
- if ( !function_exists( 'aiovg_run' ) ) {
131
/**
132
* Begins execution of the plugin.
133
*
134
* @since 1.0.0
135
- */
136
- function aiovg_run()
137
- {
138
- require AIOVG_PLUGIN_DIR . 'includes/init.php';
139
- $plugin = new AIOVG_Init();
140
- $plugin->run();
141
- }
142
-
143
- aiovg_run();
144
- }
145
-
146
-
147
- if ( !function_exists( 'aiovg_uninstall' ) ) {
148
/**
149
* The code that runs during plugin uninstallation.
150
* This action is documented in includes/uninstall.php
151
- */
152
- function aiovg_uninstall()
153
- {
154
- require_once AIOVG_PLUGIN_DIR . 'includes/uninstall.php';
155
- AIOVG_Uninstall::uninstall();
156
- }
157
-
158
- aiovg_fs()->add_action( 'after_uninstall', 'aiovg_uninstall' );
159
- }
1
+ <?php
2
+
3
/**
4
* The plugin bootstrap file.
5
*
11
* Plugin Name: All-in-One Video Gallery
12
* Plugin URI: https://plugins360.com/all-in-one-video-gallery/
13
* Description: No coding required. A Responsive & Lightweight video gallery plugin. HTML5 Player, Categories, Visual Builder (Gutenberg), Search Form, Comments, Social Sharing and everything you will need to build a YouTube/Vimeo like video sharing website.
14
+ * Version: 2.0.0
15
* Author: Team Plugins360
16
* Author URI: https://plugins360.com
17
* License: GPL-2.0+
18
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
19
* Text Domain: all-in-one-video-gallery
20
* Domain Path: /languages
21
+ *
22
+ */
23
+ // Exit if accessed directly
24
+ if ( !defined( 'WPINC' ) ) {
25
+ die;
26
+ }
27
+
28
+ if ( function_exists( 'aiovg_fs' ) ) {
29
+ aiovg_fs()->set_basename( false, __FILE__ );
30
+ return;
31
+ }
32
+
33
+
34
+ if ( !function_exists( 'aiovg_fs' ) ) {
35
+ // Create a helper function for easy SDK access
36
+ function aiovg_fs()
37
+ {
38
+ global $aiovg_fs ;
39
+
40
+ if ( !isset( $aiovg_fs ) ) {
41
+ // Activate multisite network integration
42
+ if ( !defined( 'WP_FS__PRODUCT_3213_MULTISITE' ) ) {
43
+ define( 'WP_FS__PRODUCT_3213_MULTISITE', true );
44
+ }
45
+ // Include Freemius SDK
46
+ require_once dirname( __FILE__ ) . '/freemius/start.php';
47
+ $aiovg_fs = fs_dynamic_init( array(
48
+ 'id' => '3213',
49
+ 'slug' => 'all-in-one-video-gallery',
50
+ 'type' => 'plugin',
51
+ 'public_key' => 'pk_e1bed9a9a8957abe8947bb2619ab7',
52
+ 'is_premium' => false,
53
+ 'has_addons' => false,
54
+ 'has_paid_plans' => true,
55
+ 'trial' => array(
56
+ 'days' => 7,
57
+ 'is_require_payment' => false,
58
+ ),
59
+ 'menu' => array(
60
+ 'slug' => 'all-in-one-video-gallery',
61
+ 'first-path' => 'admin.php?page=all-in-one-video-gallery',
62
+ 'support' => false,
63
+ ),
64
+ 'is_live' => true,
65
+ ) );
66
+ }
67
+
68
+ return $aiovg_fs;
69
+ }
70
+
71
+ // Init Freemius
72
+ aiovg_fs();
73
+ // Signal that SDK was initiated
74
+ do_action( 'aiovg_fs_loaded' );
75
+ }
76
+
77
+ // The current version of the plugin
78
+ if ( !defined( 'AIOVG_PLUGIN_VERSION' ) ) {
79
+ define( 'AIOVG_PLUGIN_VERSION', '2.0.0' );
80
+ }
81
+ // The unique identifier of the plugin
82
+ if ( !defined( 'AIOVG_PLUGIN_SLUG' ) ) {
83
+ define( 'AIOVG_PLUGIN_SLUG', 'all-in-one-video-gallery' );
84
+ }
85
+ // Path to the plugin directory
86
+ if ( !defined( 'AIOVG_PLUGIN_DIR' ) ) {
87
+ define( 'AIOVG_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
88
+ }
89
+ // URL of the plugin
90
+ if ( !defined( 'AIOVG_PLUGIN_URL' ) ) {
91
+ define( 'AIOVG_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
92
+ }
93
+ // The plugin file name
94
+ if ( !defined( 'AIOVG_PLUGIN_FILE_NAME' ) ) {
95
+ define( 'AIOVG_PLUGIN_FILE_NAME', plugin_basename( __FILE__ ) );
96
+ }
97
+ // The global plugin variable
98
+ $aiovg = array();
99
+
100
+ if ( !function_exists( 'aiovg_activate' ) ) {
101
/**
102
* The code that runs during plugin activation.
103
* This action is documented in includes/activator.php
104
+ */
105
+ function aiovg_activate()
106
+ {
107
+ require_once AIOVG_PLUGIN_DIR . 'includes/activator.php';
108
+ AIOVG_Activator::activate();
109
+ }
110
+
111
+ register_activation_hook( __FILE__, 'aiovg_activate' );
112
+ }
113
+
114
+
115
+ if ( !function_exists( 'aiovg_deactivate' ) ) {
116
/**
117
* The code that runs during plugin deactivation.
118
* This action is documented in includes/deactivator.php
119
+ */
120
+ function aiovg_deactivate()
121
+ {
122
+ require_once AIOVG_PLUGIN_DIR . 'includes/deactivator.php';
123
+ AIOVG_Deactivator::deactivate();
124
+ }
125
+
126
+ register_deactivation_hook( __FILE__, 'aiovg_deactivate' );
127
+ }
128
+
129
+
130
+ if ( !function_exists( 'aiovg_run' ) ) {
131
/**
132
* Begins execution of the plugin.
133
*
134
* @since 1.0.0
135
+ */
136
+ function aiovg_run()
137
+ {
138
+ require AIOVG_PLUGIN_DIR . 'includes/init.php';
139
+ $plugin = new AIOVG_Init();
140
+ $plugin->run();
141
+ }
142
+
143
+ aiovg_run();
144
+ }
145
+
146
+
147
+ if ( !function_exists( 'aiovg_uninstall' ) ) {
148
/**
149
* The code that runs during plugin uninstallation.
150
* This action is documented in includes/uninstall.php
151
+ */
152
+ function aiovg_uninstall()
153
+ {
154
+ require_once AIOVG_PLUGIN_DIR . 'includes/uninstall.php';
155
+ AIOVG_Uninstall::uninstall();
156
+ }
157
+
158
+ aiovg_fs()->add_action( 'after_uninstall', 'aiovg_uninstall' );
159
+ }
freemius/assets/img/all-in-one-video-gallery.png ADDED
Binary file
includes/functions.php CHANGED
@@ -60,6 +60,27 @@ function aiovg_can_use_yoast() {
60
return $can_use_yoast;
61
}
62
63
/**
64
* Whether the current user has a specific capability.
65
*
@@ -359,7 +380,7 @@ function aiovg_get_default_settings() {
359
'fullscreen' => 'fullscreen'
360
),
361
'use_native_controls' => array(
362
- 'dailymotion' => 'dailymotion'
363
)
364
),
365
'aiovg_videos_settings' => array(
@@ -465,14 +486,20 @@ function aiovg_get_embedcode_image_url( $embedcode ) {
465
* Get the video excerpt.
466
*
467
* @since 1.0.0
468
* @param int $char_length Excerpt length.
469
* @return string $content Excerpt content.
470
*/
471
- function aiovg_get_excerpt( $char_length = 55 ) {
472
- global $post;
473
-
474
$content = '';
475
476
if ( ! empty( $post->post_excerpt ) ) {
477
$content = $post->post_excerpt;
478
} else {
@@ -488,7 +515,7 @@ function aiovg_get_excerpt( $char_length = 55 ) {
488
} else {
489
$content = $subex;
490
}
491
- $content .= '[...]';
492
} else {
493
$content = $excerpt;
494
}
@@ -531,6 +558,31 @@ function aiovg_get_image_url( $id, $size = "large", $default = '', $type = 'gall
531
return $url;
532
}
533
534
/**
535
* Get message to display based on the $type input.
536
*
@@ -553,26 +605,6 @@ function aiovg_get_message( $msg_id ) {
553
return $message;
554
}
555
556
- /**
557
- * Get current page number.
558
- *
559
- * @since 1.0.0
560
- * @return int $paged The current page number.
561
- */
562
- function aiovg_get_page_number() {
563
- global $paged;
564
-
565
- if ( get_query_var( 'paged' ) ) {
566
- $paged = get_query_var( 'paged' );
567
- } elseif ( get_query_var( 'page' ) ) {
568
- $paged = get_query_var( 'page' );
569
- } else {
570
- $paged = 1;
571
- }
572
-
573
- return absint( $paged );
574
- }
575
-
576
/**
577
* Get MySQL's RAND function seed value.
578
*
@@ -603,6 +635,26 @@ function aiovg_get_orderby_rand_seed() {
603
return $seed;
604
}
605
606
/**
607
* Get player HTML.
608
*
@@ -612,6 +664,14 @@ function aiovg_get_orderby_rand_seed() {
612
* @return string $html Player HTML.
613
*/
614
function aiovg_get_player_html( $post_id = 0, $atts = array() ) {
615
// Vars
616
$player_settings = get_option( 'aiovg_player_settings' );
617
@@ -1637,7 +1697,7 @@ function the_aiovg_category_thumbnail( $term, $attributes ) {
1637
* @param int $char_length Excerpt length.
1638
*/
1639
function the_aiovg_excerpt( $char_length ) {
1640
- echo aiovg_get_excerpt( $char_length );
1641
}
1642
1643
/**
@@ -1807,17 +1867,7 @@ function the_aiovg_socialshare_buttons() {
1807
* @param array $atts Array of attributes.
1808
*/
1809
function the_aiovg_video_attributes( $atts ) {
1810
- $attributes = array();
1811
-
1812
- foreach ( $atts as $key => $value ) {
1813
- if ( '' === $value ) {
1814
- $attributes[] = $key;
1815
- } else {
1816
- $attributes[] = sprintf( '%s="%s"', $key, $value );
1817
- }
1818
- }
1819
-
1820
- echo implode( ' ', $attributes );
1821
}
1822
1823
/**
60
return $can_use_yoast;
61
}
62
63
+ /**
64
+ * Combine video attributes as a string.
65
+ *
66
+ * @since 2.0.0
67
+ * @param array $atts Array of video attributes.
68
+ * @param string Combined attributes string.
69
+ */
70
+ function aiovg_combine_video_attributes( $atts ) {
71
+ $attributes = array();
72
+
73
+ foreach ( $atts as $key => $value ) {
74
+ if ( '' === $value ) {
75
+ $attributes[] = $key;
76
+ } else {
77
+ $attributes[] = sprintf( '%s="%s"', $key, $value );
78
+ }
79
+ }
80
+
81
+ return implode( ' ', $attributes );
82
+ }
83
+
84
/**
85
* Whether the current user has a specific capability.
86
*
380
'fullscreen' => 'fullscreen'
381
),
382
'use_native_controls' => array(
383
+ 'facebook' => 'facebook'
384
)
385
),
386
'aiovg_videos_settings' => array(
486
* Get the video excerpt.
487
*
488
* @since 1.0.0
489
+ * @param int $post_id Post ID.
490
* @param int $char_length Excerpt length.
491
+ * @param string $append String to append to the end of the excerpt.
492
* @return string $content Excerpt content.
493
*/
494
+ function aiovg_get_excerpt( $post_id = 0 , $char_length = 55, $append = '[...]' ) {
495
$content = '';
496
497
+ if ( $post_id > 0 ) {
498
+ $post = get_post( $post_id );
499
+ } else {
500
+ global $post;
501
+ }
502
+
503
if ( ! empty( $post->post_excerpt ) ) {
504
$content = $post->post_excerpt;
505
} else {
515
} else {
516
$content = $subex;
517
}
518
+ $content .= $append;
519
} else {
520
$content = $excerpt;
521
}
558
return $url;
559
}
560
561
+ /**
562
+ * Get the client IP Address.
563
+ *
564
+ * @since 2.0.0
565
+ * @return string $ip_address The client IP Address.
566
+ */
567
+ function aiovg_get_ip_address() {
568
+ // Whether ip is from share internet
569
+ if ( ! empty( $_SERVER['HTTP_CLIENT_IP'] ) ) {
570
+ $ip_address = $_SERVER['HTTP_CLIENT_IP'];
571
+ }
572
+
573
+ // Whether ip is from proxy
574
+ elseif ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
575
+ $ip_address = $_SERVER['HTTP_X_FORWARDED_FOR'];
576
+ }
577
+
578
+ // Whether ip is from remote address
579
+ else {
580
+ $ip_address = $_SERVER['REMOTE_ADDR'];
581
+ }
582
+
583
+ return $ip_address;
584
+ }
585
+
586
/**
587
* Get message to display based on the $type input.
588
*
605
return $message;
606
}
607
608
/**
609
* Get MySQL's RAND function seed value.
610
*
635
return $seed;
636
}
637
638
+ /**
639
+ * Get current page number.
640
+ *
641
+ * @since 1.0.0
642
+ * @return int $paged The current page number.
643
+ */
644
+ function aiovg_get_page_number() {
645
+ global $paged;
646
+
647
+ if ( get_query_var( 'paged' ) ) {
648
+ $paged = get_query_var( 'paged' );
649
+ } elseif ( get_query_var( 'page' ) ) {
650
+ $paged = get_query_var( 'page' );
651
+ } else {
652
+ $paged = 1;
653
+ }
654
+
655
+ return absint( $paged );
656
+ }
657
+
658
/**
659
* Get player HTML.
660
*
664
* @return string $html Player HTML.
665
*/
666
function aiovg_get_player_html( $post_id = 0, $atts = array() ) {
667
+ if ( function_exists( 'ampforwp_is_amp_endpoint' ) && ampforwp_is_amp_endpoint() ) {
668
+ ob_start();
669
+ include apply_filters( 'aiovg_load_template', AIOVG_PLUGIN_DIR . 'public/templates/player-amp.php' );
670
+ $html = ob_get_clean();
671
+
672
+ return $html;
673
+ }
674
+
675
// Vars
676
$player_settings = get_option( 'aiovg_player_settings' );
677
1697
* @param int $char_length Excerpt length.
1698
*/
1699
function the_aiovg_excerpt( $char_length ) {
1700
+ echo aiovg_get_excerpt( 0, $char_length );
1701
}
1702
1703
/**
1867
* @param array $atts Array of attributes.
1868
*/
1869
function the_aiovg_video_attributes( $atts ) {
1870
+ echo aiovg_combine_video_attributes( $atts );
1871
}
1872
1873
/**
includes/uninstall.php CHANGED
@@ -1,5 +1,5 @@
1
- <?php
2
-
3
/**
4
* Fired during plugin uninstallation.
5
*
@@ -7,94 +7,94 @@
7
* @since 1.0.0
8
*
9
* @package All_In_One_Video_Gallery
10
- */
11
- // Exit if accessed directly
12
- if ( !defined( 'WPINC' ) ) {
13
- die;
14
- }
15
/**
16
* AIOVG_Uninstall class.
17
*
18
* @since 1.0.0
19
- */
20
- class AIOVG_Uninstall
21
- {
22
/**
23
* Called when the plugin is uninstalled.
24
*
25
* @since 1.0.0
26
- */
27
- public static function uninstall()
28
- {
29
- $general_settings = get_option( 'aiovg_general_settings' );
30
- if ( empty($general_settings['delete_plugin_data']) ) {
31
- return;
32
- }
33
- global $wpdb ;
34
- // Delete all the custom post types
35
- $aiovg_post_types = array( 'aiovg_videos' );
36
- foreach ( $aiovg_post_types as $post_type ) {
37
- $items = get_posts( array(
38
- 'post_type' => $post_type,
39
- 'post_status' => 'any',
40
- 'numberposts' => -1,
41
- 'fields' => 'ids',
42
- ) );
43
- if ( count( $items ) ) {
44
- foreach ( $items as $item ) {
45
- wp_delete_post( $item, true );
46
- }
47
- }
48
- }
49
- // Delete all the terms & taxonomies
50
- $aiovg_taxonomies = array( 'aiovg_categories' );
51
- foreach ( $aiovg_taxonomies as $taxonomy ) {
52
- $terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) );
53
- // Delete terms
54
- if ( count( $terms ) ) {
55
- foreach ( $terms as $term ) {
56
- $wpdb->delete( $wpdb->term_taxonomy, array(
57
- 'term_taxonomy_id' => $term->term_taxonomy_id,
58
- ) );
59
- $wpdb->delete( $wpdb->terms, array(
60
- 'term_id' => $term->term_id,
61
- ) );
62
- }
63
- }
64
- // Delete taxonomies
65
- $wpdb->delete( $wpdb->term_taxonomy, array(
66
- 'taxonomy' => $taxonomy,
67
- ), array( '%s' ) );
68
- }
69
- // Delete the plugin pages
70
- if ( $aiovg_created_pages = get_option( 'aiovg_page_settings' ) ) {
71
- foreach ( $aiovg_created_pages as $page => $id ) {
72
- if ( $id > 0 ) {
73
- wp_delete_post( $id, true );
74
- }
75
- }
76
- }
77
- // Delete all the plugin options
78
- $aiovg_settings = array(
79
- 'aiovg_general_settings',
80
- 'aiovg_player_settings',
81
- 'aiovg_brand_settings',
82
- 'aiovg_image_settings',
83
- 'aiovg_categories_settings',
84
- 'aiovg_videos_settings',
85
- 'aiovg_video_settings',
86
- 'aiovg_privacy_settings',
87
- 'aiovg_permalink_settings',
88
- 'aiovg_socialshare_settings',
89
- 'aiovg_page_settings',
90
- 'aiovg_version'
91
- );
92
- foreach ( $aiovg_settings as $settings ) {
93
- delete_option( $settings );
94
- }
95
- // Delete capabilities
96
- $roles = new AIOVG_Roles();
97
- $roles->remove_caps();
98
- }
99
-
100
}
1
+ <?php
2
+
3
/**
4
* Fired during plugin uninstallation.
5
*
7
* @since 1.0.0
8
*
9
* @package All_In_One_Video_Gallery
10
+ */
11
+ // Exit if accessed directly
12
+ if ( !defined( 'WPINC' ) ) {
13
+ die;
14
+ }
15
/**
16
* AIOVG_Uninstall class.
17
*
18
* @since 1.0.0
19
+ */
20
+ class AIOVG_Uninstall
21
+ {
22
/**
23
* Called when the plugin is uninstalled.
24
*
25
* @since 1.0.0
26
+ */
27
+ public static function uninstall()
28
+ {
29
+ $general_settings = get_option( 'aiovg_general_settings' );
30
+ if ( empty($general_settings['delete_plugin_data']) ) {
31
+ return;
32
+ }
33
+ global $wpdb ;
34
+ // Delete all the custom post types
35
+ $aiovg_post_types = array( 'aiovg_videos' );
36
+ foreach ( $aiovg_post_types as $post_type ) {
37
+ $items = get_posts( array(
38
+ 'post_type' => $post_type,
39
+ 'post_status' => 'any',
40
+ 'numberposts' => -1,
41
+ 'fields' => 'ids',
42
+ ) );
43
+ if ( count( $items ) ) {
44
+ foreach ( $items as $item ) {
45
+ wp_delete_post( $item, true );
46
+ }
47
+ }
48
+ }
49
+ // Delete all the terms & taxonomies
50
+ $aiovg_taxonomies = array( 'aiovg_categories' );
51
+ foreach ( $aiovg_taxonomies as $taxonomy ) {
52
+ $terms = $wpdb->get_results( $wpdb->prepare( "SELECT t.*, tt.* FROM {$wpdb->terms} AS t INNER JOIN {$wpdb->term_taxonomy} AS tt ON t.term_id = tt.term_id WHERE tt.taxonomy IN ('%s') ORDER BY t.name ASC", $taxonomy ) );
53
+ // Delete terms
54
+ if ( count( $terms ) ) {
55
+ foreach ( $terms as $term ) {
56
+ $wpdb->delete( $wpdb->term_taxonomy, array(
57
+ 'term_taxonomy_id' => $term->term_taxonomy_id,
58
+ ) );
59
+ $wpdb->delete( $wpdb->terms, array(
60
+ 'term_id' => $term->term_id,
61
+ ) );
62
+ }
63
+ }
64
+ // Delete taxonomies
65
+ $wpdb->delete( $wpdb->term_taxonomy, array(
66
+ 'taxonomy' => $taxonomy,
67
+ ), array( '%s' ) );
68
+ }
69
+ // Delete the plugin pages
70
+ if ( $aiovg_created_pages = get_option( 'aiovg_page_settings' ) ) {
71
+ foreach ( $aiovg_created_pages as $page => $id ) {
72
+ if ( $id > 0 ) {
73
+ wp_delete_post( $id, true );
74
+ }
75
+ }
76
+ }
77
+ // Delete all the plugin options
78
+ $aiovg_settings = array(
79
+ 'aiovg_general_settings',
80
+ 'aiovg_player_settings',
81
+ 'aiovg_brand_settings',
82
+ 'aiovg_image_settings',
83
+ 'aiovg_categories_settings',
84
+ 'aiovg_videos_settings',
85
+ 'aiovg_video_settings',
86
+ 'aiovg_privacy_settings',
87
+ 'aiovg_permalink_settings',
88
+ 'aiovg_socialshare_settings',
89
+ 'aiovg_page_settings',
90
+ 'aiovg_version'
91
+ );
92
+ foreach ( $aiovg_settings as $settings ) {
93
+ delete_option( $settings );
94
+ }
95
+ // Delete capabilities
96
+ $roles = new AIOVG_Roles();
97
+ $roles->remove_caps();
98
+ }
99
+
100
}
public/assets/mediaelement/renderers/dailymotion.js DELETED
@@ -1,415 +0,0 @@
1
- /*!
2
- * MediaElement.js
3
- * http://www.mediaelementjs.com/
4
- *
5
- * Wrapper that mimics native HTML5 MediaElement (audio and video)
6
- * using a variety of technologies (pure JavaScript, Flash, iframe)
7
- *
8
- * Copyright 2010-2017, John Dyer (http://j.hn/)
9
- * License: MIT
10
- *
11
- */(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
12
- 'use strict';
13
-
14
- var DailyMotionApi = {
15
- isSDKStarted: false,
16
-
17
- isSDKLoaded: false,
18
-
19
- iframeQueue: [],
20
-
21
- enqueueIframe: function enqueueIframe(settings) {
22
-
23
- if (DailyMotionApi.isLoaded) {
24
- DailyMotionApi.createIframe(settings);
25
- } else {
26
- DailyMotionApi.loadIframeApi();
27
- DailyMotionApi.iframeQueue.push(settings);
28
- }
29
- },
30
-
31
- loadIframeApi: function loadIframeApi() {
32
- if (!DailyMotionApi.isSDKStarted) {
33
- mejs.Utils.loadScript('https://api.dmcdn.net/all.js');
34
- DailyMotionApi.isSDKStarted = true;
35
- }
36
- },
37
-
38
- apiReady: function apiReady() {
39
-
40
- DailyMotionApi.isLoaded = true;
41
- DailyMotionApi.isSDKLoaded = true;
42
-
43
- while (DailyMotionApi.iframeQueue.length > 0) {
44
- var settings = DailyMotionApi.iframeQueue.pop();
45
-
46
- DM.init({
47
- apiKey: settings.apiKey,
48
- status: settings.status,
49
- cookie: settings.cookie
50
- });
51
-
52
- DailyMotionApi.createIframe(settings);
53
- }
54
- },
55
-
56
- createIframe: function createIframe(settings) {
57
-
58
- var player = DM.player(settings.container, {
59
- height: settings.height || '100%',
60
- width: settings.width || '100%',
61
- video: settings.videoId,
62
- params: Object.assign({ api: true }, settings.params),
63
- origin: location.host
64
- });
65
-
66
- player.addEventListener('apiready', function () {
67
- window['__ready__' + settings.id](player, { paused: true, ended: false });
68
- });
69
- },
70
-
71
- getDailyMotionId: function getDailyMotionId(url) {
72
- var parts = url.split('/'),
73
- lastPart = parts[parts.length - 1],
74
- dashParts = lastPart.split('_');
75
-
76
- return dashParts[0];
77
- }
78
- };
79
-
80
- var DailyMotionIframeRenderer = {
81
- name: 'dailymotion_iframe',
82
- options: {
83
- prefix: 'dailymotion_iframe',
84
- dailymotion: {
85
- width: '100%',
86
- height: '100%',
87
- params: {
88
- autoplay: false,
89
- chromeless: 1,
90
- info: 0,
91
- logo: 0,
92
- related: 0
93
- },
94
- apiKey: null,
95
- status: true,
96
- cookie: true
97
- }
98
- },
99
-
100
- canPlayType: function canPlayType(type) {
101
- return ~['video/dailymotion', 'video/x-dailymotion'].indexOf(type.toLowerCase());
102
- },
103
-
104
- create: function create(mediaElement, options, mediaFiles) {
105
-
106
- var dm = {},
107
- apiStack = [],
108
- readyState = 4;
109
-
110
- var events = void 0,
111
- dmPlayer = null,
112
- dmIframe = null,
113
- muted = mediaElement.originalNode.muted;
114
-
115
- dm.options = options;
116
- dm.id = mediaElement.id + '_' + options.prefix;
117
- dm.mediaElement = mediaElement;
118
-
119
- var props = mejs.html5media.properties,
120
- assignGettersSetters = function assignGettersSetters(propName) {
121
-
122
- var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
123
-
124
- dm['get' + capName] = function () {
125
- if (dmPlayer !== null) {
126
- var value = null;
127
-
128
- switch (propName) {
129
- case 'currentTime':
130
- return dmPlayer.currentTime;
131
- case 'duration':
132
- return isNaN(dmPlayer.duration) ? 0 : dmPlayer.duration;
133
- case 'volume':
134
- return dmPlayer.volume;
135
- case 'paused':
136
- return dmPlayer.paused;
137
- case 'ended':
138
- return dmPlayer.ended;
139
- case 'muted':
140
- muted = dmPlayer.muted;
141
- return muted;
142
- case 'buffered':
143
- var percentLoaded = dmPlayer.bufferedTime,
144
- duration = dmPlayer.duration;
145
- return {
146
- start: function start() {
147
- return 0;
148
- },
149
- end: function end() {
150
- return percentLoaded / duration;
151
- },
152
- length: 1
153
- };
154
- case 'src':
155
- return mediaElement.originalNode.getAttribute('src');
156
- case 'readyState':
157
- return readyState;
158
- }
159
-
160
- return value;
161
- } else {
162
- return null;
163
- }
164
- };
165
-
166
- dm['set' + capName] = function (value) {
167
- if (dmPlayer !== null) {
168
- switch (propName) {
169
- case 'src':
170
- var url = typeof value === 'string' ? value : value[0].src;
171
- dmPlayer.load(DailyMotionApi.getDailyMotionId(url));
172
- break;
173
- case 'currentTime':
174
- dmPlayer.seek(value);
175
- break;
176
- case 'muted':
177
- if (value === true) {
178
- dmPlayer.setVolume(0);
179
- }
180
- dmPlayer.setMuted(value);
181
- muted = value;
182
- setTimeout(function () {
183
- var event = mejs.Utils.createEvent('volumechange', dm);
184
- mediaElement.dispatchEvent(event);
185
- }, 50);
186
- break;
187
- case 'volume':
188
- dmPlayer.setVolume(value);
189
- if (value === 0 && !dmPlayer.muted) {
190
- dmPlayer.setMuted(true);
191
- muted = true;
192
- } else if (value > 0 && dmPlayer.muted) {
193
- dmPlayer.setMuted(false);
194
- muted = false;
195
- }
196
-
197
- setTimeout(function () {
198
- var event = mejs.Utils.createEvent('volumechange', dm);
199
- mediaElement.dispatchEvent(event);
200
- }, 50);
201
- break;
202
- case 'readyState':
203
- var event = mejs.Utils.createEvent('canplay', dm);
204
- mediaElement.dispatchEvent(event);
205
- break;
206
- default:
207
-
208
- break;
209
- }
210
- } else {
211
- apiStack.push({ type: 'set', propName: propName, value: value });
212
- }
213
- };
214
- };
215
-
216
- for (var i = 0, total = props.length; i < total; i++) {
217
- assignGettersSetters(props[i]);
218
- }
219
-
220
- var methods = mejs.html5media.methods,
221
- assignMethods = function assignMethods(methodName) {
222
- dm[methodName] = function () {
223
- if (dmPlayer !== null) {
224
- switch (methodName) {
225
- case 'play':
226
- return dmPlayer.play();
227
- case 'pause':
228
- return dmPlayer.pause();
229
- case 'load':
230
- return null;
231
- }
232
- } else {
233
- apiStack.push({ type: 'call', methodName: methodName });
234
- }
235
- };
236
- };
237
-
238
- for (var _i = 0, _total = methods.length; _i < _total; _i++) {
239
- assignMethods(methods[_i]);
240
- }
241
-
242
- window['__ready__' + dm.id] = function (_dmPlayer) {
243
-
244
- mediaElement.dmPlayer = dmPlayer = _dmPlayer;
245
-
246
- if (apiStack.length) {
247
- for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
248
-
249
- var stackItem = apiStack[_i2];
250
-
251
- if (stackItem.type === 'set') {
252
- var propName = stackItem.propName,
253
- capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
254
-
255
- dm['set' + capName](stackItem.value);
256
- } else if (stackItem.type === 'call') {
257
- dm[stackItem.methodName]();
258
- }
259
- }
260
- }
261
-
262
- dmIframe = document.getElementById(dm.id);
263
-
264
- events = ['mouseover', 'mouseout'];
265
- var assignEvents = function assignEvents(e) {
266
- var event = mejs.Utils.createEvent(e.type, dm);
267
- mediaElement.dispatchEvent(event);
268
- };
269
-
270
- for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
271
- dmIframe.addEventListener(events[_i3], assignEvents, false);
272
- }
273
-
274
- if (mediaElement.originalNode.muted) {
275
- dmPlayer.setVolume(0);
276
- dmPlayer.setMuted(true);
277
- } else {
278
- dmPlayer.setVolume(dmPlayer.volume);
279
- dmPlayer.setMuted(false);
280
- }
281
-
282
- events = mejs.html5media.events;
283
- events = events.concat(['click', 'mouseover', 'mouseout']);
284
- var assignNativeEvents = function assignNativeEvents(eventName) {
285
- if (eventName !== 'ended') {
286
- dmPlayer.addEventListener(eventName, function (e) {
287
- var event = mejs.Utils.createEvent(e.type, dm);
288
- mediaElement.dispatchEvent(event);
289
- });
290
- }
291
- };
292
-
293
- for (var _i4 = 0, _total4 = events.length; _i4 < _total4; _i4++) {
294
- assignNativeEvents(events[_i4]);
295
- }
296
-
297
- dmPlayer.addEventListener('ad_start', function () {
298
- var event = mejs.Utils.createEvent('play', dm);
299
- mediaElement.dispatchEvent(event);
300
-
301
- event = mejs.Utils.createEvent('progress', dm);
302
- mediaElement.dispatchEvent(event);
303
-
304
- event = mejs.Utils.createEvent('timeupdate', dm);
305
- mediaElement.dispatchEvent(event);
306
- });
307
- dmPlayer.addEventListener('ad_timeupdate', function () {
308
- var event = mejs.Utils.createEvent('timeupdate', dm);
309
- mediaElement.dispatchEvent(event);
310
- });
311
- dmPlayer.addEventListener('ad_pause', function () {
312
- var event = mejs.Utils.createEvent('pause', dm);
313
- mediaElement.dispatchEvent(event);
314
- });
315
- dmPlayer.addEventListener('start', function () {
316
- if (dmPlayer.muted) {
317
- var event = mejs.Utils.createEvent('volumechange', dm);
318
- mediaElement.dispatchEvent(event);
319
- }
320
- });
321
- dmPlayer.addEventListener('video_start', function () {
322
- var event = mejs.Utils.createEvent('play', dm);
323
- mediaElement.dispatchEvent(event);
324
-
325
- var playingEvent = mejs.Utils.createEvent('playing', dm);
326
- mediaElement.dispatchEvent(playingEvent);
327
- });
328
- dmPlayer.addEventListener('ad_timeupdate', function () {
329
- var event = mejs.Utils.createEvent('timeupdate', dm);
330
- mediaElement.dispatchEvent(event);
331
- });
332
- dmPlayer.addEventListener('video_end', function () {
333
- var event = mejs.Utils.createEvent('ended', dm);
334
- mediaElement.dispatchEvent(event);
335
-
336
- if (mediaElement.originalNode.getAttribute('loop')) {
337
- dmPlayer.play();
338
- }
339
- });
340
-
341
- var initEvents = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
342
-
343
- for (var _i5 = 0, _total5 = initEvents.length; _i5 < _total5; _i5++) {
344
- var event = mejs.Utils.createEvent(initEvents[_i5], dm);
345
- mediaElement.dispatchEvent(event);
346
- }
347
- };
348
-
349
- var dmContainer = document.createElement('div');
350
- dmContainer.id = dm.id;
351
- mediaElement.appendChild(dmContainer);
352
- if (mediaElement.originalNode) {
353
- dmContainer.style.width = mediaElement.originalNode.style.width;
354
- dmContainer.style.height = mediaElement.originalNode.style.height;
355
- }
356
- mediaElement.originalNode.style.display = 'none';
357
-
358
- var videoId = DailyMotionApi.getDailyMotionId(mediaFiles[0].src),
359
- dmSettings = {
360
- id: dm.id,
361
- container: dmContainer,
362
- videoId: videoId
363
- };
364
-
365
- dmSettings.params = Object.assign({}, dm.options.dailymotion);
366
-
367
- dmSettings.params.controls = !!mediaElement.originalNode.controls;
368
-
369
- if (mediaElement.originalNode.autoplay) {
370
- dmSettings.params.autoplay = true;
371
- }
372
- if (mediaElement.originalNode.muted) {
373
- dmSettings.params.mute = true;
374
- }
375
- dmSettings.params.api = '1';
376
-
377
- DailyMotionApi.enqueueIframe(dmSettings);
378
-
379
- dm.hide = function () {
380
- dm.pause();
381
- if (dmIframe) {
382
- dmIframe.style.display = 'none';
383
- }
384
- };
385
- dm.show = function () {
386
- if (dmIframe) {
387
- dmIframe.style.display = '';
388
- }
389
- };
390
- dm.setSize = function (width, height) {
391
- if (dmIframe) {
392
- dmIframe.width = width;
393
- dmIframe.height = height;
394
- }
395
- };
396
- dm.destroy = function () {
397
- dmPlayer.destroy();
398
- };
399
-
400
- return dm;
401
- }
402
- };
403
-
404
- mejs.Utils.typeChecks.push(function (url) {
405
- return (/\/\/((www\.)?dailymotion\.com|dai\.ly)/i.test(url) ? 'video/x-dailymotion' : null
406
- );
407
- });
408
-
409
- window.dmAsyncInit = function () {
410
- DailyMotionApi.apiReady();
411
- };
412
-
413
- mejs.Renderers.add(DailyMotionIframeRenderer);
414
-
415
- },{}]},{},[1]);
public/assets/mediaelement/renderers/dailymotion.min.js DELETED
@@ -1,12 +0,0 @@
1
- /*!
2
- * MediaElement.js
3
- * http://www.mediaelementjs.com/
4
- *
5
- * Wrapper that mimics native HTML5 MediaElement (audio and video)
6
- * using a variety of technologies (pure JavaScript, Flash, iframe)
7
- *
8
- * Copyright 2010-2017, John Dyer (http://j.hn/)
9
- * License: MIT
10
- *
11
- */
12
- !function e(t,a,n){function i(s,o){if(!a[s]){if(!t[s]){var d="function"==typeof require&&require;if(!o&&d)return d(s,!0);if(r)return r(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var l=a[s]={exports:{}};t[s][0].call(l.exports,function(e){var a=t[s][1][e];return i(a||e)},l,l.exports,e,t,a,n)}return a[s].exports}for(var r="function"==typeof require&&require,s=0;s<n.length;s++)i(n[s]);return i}({1:[function(e,t,a){"use strict";var n={isSDKStarted:!1,isSDKLoaded:!1,iframeQueue:[],enqueueIframe:function(e){n.isLoaded?n.createIframe(e):(n.loadIframeApi(),n.iframeQueue.push(e))},loadIframeApi:function(){n.isSDKStarted||(mejs.Utils.loadScript("https://api.dmcdn.net/all.js"),n.isSDKStarted=!0)},apiReady:function(){for(n.isLoaded=!0,n.isSDKLoaded=!0;n.iframeQueue.length>0;){var e=n.iframeQueue.pop();DM.init({apiKey:e.apiKey,status:e.status,cookie:e.cookie}),n.createIframe(e)}},createIframe:function(e){var t=DM.player(e.container,{height:e.height||"100%",width:e.width||"100%",video:e.videoId,params:Object.assign({api:!0},e.params),origin:location.host});t.addEventListener("apiready",function(){window["__ready__"+e.id](t,{paused:!0,ended:!1})})},getDailyMotionId:function(e){var t=e.split("/");return t[t.length-1].split("_")[0]}},i={name:"dailymotion_iframe",options:{prefix:"dailymotion_iframe",dailymotion:{width:"100%",height:"100%",params:{autoplay:!1,chromeless:1,info:0,logo:0,related:0},apiKey:null,status:!0,cookie:!0}},canPlayType:function(e){return~["video/dailymotion","video/x-dailymotion"].indexOf(e.toLowerCase())},create:function(e,t,a){var i={},r=[],s=void 0,o=null,d=null,u=e.originalNode.muted;i.options=t,i.id=e.id+"_"+t.prefix,i.mediaElement=e;for(var l=mejs.html5media.properties,c=0,m=l.length;c<m;c++)!function(t){var a=""+t.substring(0,1).toUpperCase()+t.substring(1);i["get"+a]=function(){if(null!==o){switch(t){case"currentTime":return o.currentTime;case"duration":return isNaN(o.duration)?0:o.duration;case"volume":return o.volume;case"paused":return o.paused;case"ended":return o.ended;case"muted":return u=o.muted;case"buffered":var a=o.bufferedTime,n=o.duration;return{start:function(){return 0},end:function(){return a/n},length:1};case"src":return e.originalNode.getAttribute("src");case"readyState":return 4}return null}return null},i["set"+a]=function(a){if(null!==o)switch(t){case"src":var s="string"==typeof a?a:a[0].src;o.load(n.getDailyMotionId(s));break;case"currentTime":o.seek(a);break;case"muted":!0===a&&o.setVolume(0),o.setMuted(a),u=a,setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",i);e.dispatchEvent(t)},50);break;case"volume":o.setVolume(a),0!==a||o.muted?a>0&&o.muted&&(o.setMuted(!1),u=!1):(o.setMuted(!0),u=!0),setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",i);e.dispatchEvent(t)},50);break;case"readyState":var d=mejs.Utils.createEvent("canplay",i);e.dispatchEvent(d)}else r.push({type:"set",propName:t,value:a})}}(l[c]);for(var p=mejs.html5media.methods,v=0,f=p.length;v<f;v++)!function(e){i[e]=function(){if(null!==o)switch(e){case"play":return o.play();case"pause":return o.pause();case"load":return null}else r.push({type:"call",methodName:e})}}(p[v]);window["__ready__"+i.id]=function(t){if(e.dmPlayer=o=t,r.length)for(var a=0,n=r.length;a<n;a++){var u=r[a];if("set"===u.type){var l=u.propName,c=""+l.substring(0,1).toUpperCase()+l.substring(1);i["set"+c](u.value)}else"call"===u.type&&i[u.methodName]()}d=document.getElementById(i.id);for(var m=0,p=(s=["mouseover","mouseout"]).length;m<p;m++)d.addEventListener(s[m],function(t){var a=mejs.Utils.createEvent(t.type,i);e.dispatchEvent(a)},!1);e.originalNode.muted?(o.setVolume(0),o.setMuted(!0)):(o.setVolume(o.volume),o.setMuted(!1)),s=mejs.html5media.events;for(var v=0,f=(s=s.concat(["click","mouseover","mouseout"])).length;v<f;v++)!function(t){"ended"!==t&&o.addEventListener(t,function(t){var a=mejs.Utils.createEvent(t.type,i);e.dispatchEvent(a)})}(s[v]);o.addEventListener("ad_start",function(){var t=mejs.Utils.createEvent("play",i);e.dispatchEvent(t),t=mejs.Utils.createEvent("progress",i),e.dispatchEvent(t),t=mejs.Utils.createEvent("timeupdate",i),e.dispatchEvent(t)}),o.addEventListener("ad_timeupdate",function(){var t=mejs.Utils.createEvent("timeupdate",i);e.dispatchEvent(t)}),o.addEventListener("ad_pause",function(){var t=mejs.Utils.createEvent("pause",i);e.dispatchEvent(t)}),o.addEventListener("start",function(){if(o.muted){var t=mejs.Utils.createEvent("volumechange",i);e.dispatchEvent(t)}}),o.addEventListener("video_start",function(){var t=mejs.Utils.createEvent("play",i);e.dispatchEvent(t);var a=mejs.Utils.createEvent("playing",i);e.dispatchEvent(a)}),o.addEventListener("ad_timeupdate",function(){var t=mejs.Utils.createEvent("timeupdate",i);e.dispatchEvent(t)}),o.addEventListener("video_end",function(){var t=mejs.Utils.createEvent("ended",i);e.dispatchEvent(t),e.originalNode.getAttribute("loop")&&o.play()});for(var h=["rendererready","loadedmetadata","loadeddata","canplay"],y=0,g=h.length;y<g;y++){var E=mejs.Utils.createEvent(h[y],i);e.dispatchEvent(E)}};var h=document.createElement("div");h.id=i.id,e.appendChild(h),e.originalNode&&(h.style.width=e.originalNode.style.width,h.style.height=e.originalNode.style.height),e.originalNode.style.display="none";var y=n.getDailyMotionId(a[0].src),g={id:i.id,container:h,videoId:y};return g.params=Object.assign({},i.options.dailymotion),g.params.controls=!!e.originalNode.controls,e.originalNode.autoplay&&(g.params.autoplay=!0),e.originalNode.muted&&(g.params.mute=!0),g.params.api="1",n.enqueueIframe(g),i.hide=function(){i.pause(),d&&(d.style.display="none")},i.show=function(){d&&(d.style.display="")},i.setSize=function(e,t){d&&(d.width=e,d.height=t)},i.destroy=function(){o.destroy()},i}};mejs.Utils.typeChecks.push(function(e){return/\/\/((www\.)?dailymotion\.com|dai\.ly)/i.test(e)?"video/x-dailymotion":null}),window.dmAsyncInit=function(){n.apiReady()},mejs.Renderers.add(i)},{}]},{},[1]);
public/assets/mediaelement/renderers/facebook.js DELETED
@@ -1,361 +0,0 @@
1
- /*!
2
- * MediaElement.js
3
- * http://www.mediaelementjs.com/
4
- *
5
- * Wrapper that mimics native HTML5 MediaElement (audio and video)
6
- * using a variety of technologies (pure JavaScript, Flash, iframe)
7
- *
8
- * Copyright 2010-2017, John Dyer (http://j.hn/)
9
- * License: MIT
10
- *
11
- */(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
12
- 'use strict';
13
-
14
- var FacebookApi = {
15
-
16
- promise: null,
17
-
18
- load: function load(settings) {
19
-
20
- if (typeof FB !== 'undefined') {
21
- FacebookApi._createPlayer(settings);
22
- } else {
23
- FacebookApi.promise = FacebookApi.promise || mejs.Utils.loadScript('https://connect.facebook.net/' + settings.options.lang + '/sdk.js');
24
- FacebookApi.promise.then(function () {
25
- FB.init(settings.options);
26
-
27
- setTimeout(function () {
28
- FacebookApi._createPlayer(settings);
29
- }, 50);
30
- });
31
- }
32
- },
33
-
34
- _createPlayer: function _createPlayer(settings) {
35
- window['__ready__' + settings.id]();
36
- }
37
- };
38
- var FacebookRenderer = {
39
- name: 'facebook',
40
- options: {
41
- prefix: 'facebook',
42
- facebook: {
43
- appId: '',
44
- xfbml: true,
45
- version: 'v2.10',
46
- lang: 'en_US'
47
- }
48
- },
49
-
50
- canPlayType: function canPlayType(type) {
51
- return ~['video/facebook', 'video/x-facebook'].indexOf(type.toLowerCase());
52
- },
53
-
54
- create: function create(mediaElement, options, mediaFiles) {
55
- var apiStack = [],
56
- fb = {},
57
- readyState = 4;
58
-
59
- var hasStartedPlaying = false,
60
- paused = true,
61
- ended = false,
62
- fbPlayer = null,
63
- src = '',
64
- poster = '',
65
- autoplay = mediaElement.originalNode.autoplay;
66
-
67
- fb.options = options;
68
- fb.id = mediaElement.id + '_' + options.prefix;
69
- fb.mediaElement = mediaElement;
70
-
71
- if (mejs.Features.isiPhone && mediaElement.originalNode.getAttribute('poster')) {
72
- poster = mediaElement.originalNode.getAttribute('poster');
73
- mediaElement.originalNode.removeAttribute('poster');
74
- }
75
-
76
- var props = mejs.html5media.properties,
77
- assignGettersSetters = function assignGettersSetters(propName) {
78
-
79
- var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
80
-
81
- fb['get' + capName] = function () {
82
-
83
- if (fbPlayer !== null) {
84
- var value = null;
85
-
86
- switch (propName) {
87
- case 'currentTime':
88
- return fbPlayer.getCurrentPosition();
89
- case 'duration':
90
- return fbPlayer.getDuration();
91
- case 'volume':
92
- return fbPlayer.getVolume();
93
- case 'paused':
94
- return paused;
95
- case 'ended':
96
- return ended;
97
- case 'muted':
98
- return fbPlayer.isMuted();
99
- case 'buffered':
100
- return {
101
- start: function start() {
102
- return 0;
103
- },
104
- end: function end() {
105
- return 0;
106
- },
107
- length: 1
108
- };
109
- case 'src':
110
- return src;
111
- case 'readyState':
112
- return readyState;
113
- }
114
-
115
- return value;
116
- } else {
117
- return null;
118
- }
119
- };
120
-
121
- fb['set' + capName] = function (value) {
122
-
123
- if (fbPlayer !== null) {
124
-
125
- switch (propName) {
126
- case 'src':
127
- var url = typeof value === 'string' ? value : value[0].src;
128
- src = url;
129
-
130
- fbContainer.remove();
131
- fbContainer = document.createElement('div');
132
- fbContainer.id = fb.id;
133
- fbContainer.className = 'fb-video';
134
- fbContainer.setAttribute('data-href', url);
135
- fbContainer.setAttribute('data-allowfullscreen', 'true');
136
- fbContainer.setAttribute('data-controls', 'false');
137
-
138
- mediaElement.originalNode.parentNode.insertBefore(fbContainer, mediaElement.originalNode);
139
- mediaElement.originalNode.style.display = 'none';
140
-
141
- FacebookApi.load({
142
- lang: fb.options.lang,
143
- id: fb.id
144
- });
145
-
146
- FB.XFBML.parse();
147
-
148
- if (autoplay) {
149
- fbPlayer.play();
150
- }
151
- break;
152
- case 'currentTime':
153
- fbPlayer.seek(value);
154
- break;
155
- case 'muted':
156
- if (value) {
157
- fbPlayer.mute();
158
- } else {
159
- fbPlayer.unmute();
160
- }
161
- setTimeout(function () {
162
- var event = mejs.Utils.createEvent('volumechange', fb);
163
- mediaElement.dispatchEvent(event);
164
- }, 50);
165
- break;
166
- case 'volume':
167
- fbPlayer.setVolume(value);
168
- setTimeout(function () {
169
- var event = mejs.Utils.createEvent('volumechange', fb);
170
- mediaElement.dispatchEvent(event);
171
- }, 50);
172
- break;
173
- case 'readyState':
174
- var event = mejs.Utils.createEvent('canplay', fb);
175
- mediaElement.dispatchEvent(event);
176
- break;
177
- default:
178
-
179
- break;
180
- }
181
- } else {
182
- apiStack.push({ type: 'set', propName: propName, value: value });
183
- }
184
- };
185
- };
186
-
187
- for (var i = 0, total = props.length; i < total; i++) {
188
- assignGettersSetters(props[i]);
189
- }
190
-
191
- var methods = mejs.html5media.methods,
192
- assignMethods = function assignMethods(methodName) {
193
- fb[methodName] = function () {
194
- if (fbPlayer !== null) {
195
- switch (methodName) {
196
- case 'play':
197
- return fbPlayer.play();
198
- case 'pause':
199
- return fbPlayer.pause();
200
- case 'load':
201
- return null;
202
- }
203
- } else {
204
- apiStack.push({ type: 'call', methodName: methodName });
205
- }
206
- };
207
- };
208
-
209
- for (var _i = 0, _total = methods.length; _i < _total; _i++) {
210
- assignMethods(methods[_i]);
211
- }
212
-
213
- function assignEvents(events) {
214
- for (var _i2 = 0, _total2 = events.length; _i2 < _total2; _i2++) {
215
- var event = mejs.Utils.createEvent(events[_i2], fb);
216
- mediaElement.dispatchEvent(event);
217
- }
218
- }
219
-
220
- window['__ready__' + fb.id] = function () {
221
- FB.Event.subscribe('xfbml.ready', function (msg) {
222
- if (msg.type === 'video' && fb.id === msg.id) {
223
- mediaElement.fbPlayer = fbPlayer = msg.instance;
224
-
225
- var fbIframe = document.getElementById(fb.id),
226
- width = fbIframe.offsetWidth,
227
- height = fbIframe.offsetHeight,
228
- events = ['mouseover', 'mouseout'],
229
- assignIframeEvents = function assignIframeEvents(e) {
230
- var event = mejs.Utils.createEvent(e.type, fb);
231
- mediaElement.dispatchEvent(event);
232
- };
233
-
234
- fb.setSize(width, height);
235
- if (!mediaElement.originalNode.muted) {
236
- fbPlayer.unmute();
237
- }
238
-
239
- if (autoplay) {
240
- fbPlayer.play();
241
- }
242
-
243
- for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
244
- fbIframe.addEventListener(events[_i3], assignIframeEvents);
245
- }
246
-
247
- fb.eventHandler = {};
248
-
249
- var fbEvents = ['startedPlaying', 'paused', 'finishedPlaying', 'startedBuffering', 'finishedBuffering'];
250
- for (var _i4 = 0, _total4 = fbEvents.length; _i4 < _total4; _i4++) {
251
- var event = fbEvents[_i4],
252
- handler = fb.eventHandler[event];
253
- if (handler !== undefined && handler !== null && !mejs.Utils.isObjectEmpty(handler) && typeof handler.removeListener === 'function') {
254
- handler.removeListener(event);
255
- }
256
- }
257
-
258
- if (apiStack.length) {
259
- for (var _i5 = 0, _total5 = apiStack.length; _i5 < _total5; _i5++) {
260
- var stackItem = apiStack[_i5];
261
-
262
- if (stackItem.type === 'set') {
263
- var propName = stackItem.propName,
264
- capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
265
-
266
- fb['set' + capName](stackItem.value);
267
- } else if (stackItem.type === 'call') {
268
- fb[stackItem.methodName]();
269
- }
270
- }
271
- }
272
-
273
- assignEvents(['rendererready', 'loadeddata', 'canplay', 'progress', 'loadedmetadata', 'timeupdate']);
274
-
275
- var timer = void 0;
276
-
277
- fb.eventHandler.startedPlaying = fbPlayer.subscribe('startedPlaying', function () {
278
- if (!hasStartedPlaying) {
279
- hasStartedPlaying = true;
280
- }
281
- paused = false;
282
- ended = false;
283
- assignEvents(['play', 'playing', 'timeupdate']);
284
-
285
- timer = setInterval(function () {
286
- fbPlayer.getCurrentPosition();
287
- assignEvents(['timeupdate']);
288
- }, 250);
289
- });
290
- fb.eventHandler.paused = fbPlayer.subscribe('paused', function () {
291
- paused = true;
292
- ended = false;
293
- assignEvents(['pause']);
294
- });
295
- fb.eventHandler.finishedPlaying = fbPlayer.subscribe('finishedPlaying', function () {
296
- paused = true;
297
- ended = true;
298
-
299
- assignEvents(['ended']);
300
- clearInterval(timer);
301
- timer = null;
302
- });
303
- fb.eventHandler.startedBuffering = fbPlayer.subscribe('startedBuffering', function () {
304
- assignEvents(['progress', 'timeupdate']);
305
- });
306
- fb.eventHandler.finishedBuffering = fbPlayer.subscribe('finishedBuffering', function () {
307
- assignEvents(['progress', 'timeupdate']);
308
- });
309
- }
310
- });
311
- };
312
-
313
- src = mediaFiles[0].src;
314
- var fbContainer = document.createElement('div');
315
- fbContainer.id = fb.id;
316
- fbContainer.className = 'fb-video';
317
- fbContainer.setAttribute('data-href', src);
318
- fbContainer.setAttribute('data-allowfullscreen', 'true');
319
- fbContainer.setAttribute('data-controls', !!mediaElement.originalNode.controls);
320
- mediaElement.originalNode.parentNode.insertBefore(fbContainer, mediaElement.originalNode);
321
- mediaElement.originalNode.style.display = 'none';
322
-
323
- FacebookApi.load({
324
- options: fb.options.facebook,
325
- id: fb.id
326
- });
327
-
328
- fb.hide = function () {
329
- fb.pause();
330
- if (fbPlayer) {
331
- fbContainer.style.display = 'none';
332
- }
333
- };
334
- fb.setSize = function (width) {
335
- if (fbPlayer !== null && !isNaN(width)) {
336
- fbContainer.style.width = width;
337
- }
338
- };
339
- fb.show = function () {
340
- if (fbPlayer) {
341
- fbContainer.style.display = '';
342
- }
343
- };
344
-
345
- fb.destroy = function () {
346
- if (poster) {
347
- mediaElement.originalNode.setAttribute('poster', poster);
348
- }
349
- };
350
-
351
- return fb;
352
- }
353
- };
354
-
355
- mejs.Utils.typeChecks.push(function (url) {
356
- return ~url.toLowerCase().indexOf('//www.facebook') ? 'video/x-facebook' : null;
357
- });
358
-
359
- mejs.Renderers.add(FacebookRenderer);
360
-
361
- },{}]},{},[1]);
public/assets/mediaelement/renderers/facebook.min.js DELETED
@@ -1,12 +0,0 @@
1
- /*!
2
- * MediaElement.js
3
- * http://www.mediaelementjs.com/
4
- *
5
- * Wrapper that mimics native HTML5 MediaElement (audio and video)
6
- * using a variety of technologies (pure JavaScript, Flash, iframe)
7
- *
8
- * Copyright 2010-2017, John Dyer (http://j.hn/)
9
- * License: MIT
10
- *
11
- */
12
- !function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var u="function"==typeof require&&require;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var l=new Error("Cannot find module '"+o+"'");throw l.code="MODULE_NOT_FOUND",l}var d=n[o]={exports:{}};t[o][0].call(d.exports,function(e){var n=t[o][1][e];return i(n||e)},d,d.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof require&&require,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){"use strict";var r={promise:null,load:function(e){"undefined"!=typeof FB?r._createPlayer(e):(r.promise=r.promise||mejs.Utils.loadScript("https://connect.facebook.net/"+e.options.lang+"/sdk.js"),r.promise.then(function(){FB.init(e.options),setTimeout(function(){r._createPlayer(e)},50)}))},_createPlayer:function(e){window["__ready__"+e.id]()}},i={name:"facebook",options:{prefix:"facebook",facebook:{appId:"",xfbml:!0,version:"v2.10",lang:"en_US"}},canPlayType:function(e){return~["video/facebook","video/x-facebook"].indexOf(e.toLowerCase())},create:function(e,t,n){function i(t){for(var n=0,r=t.length;n<r;n++){var i=mejs.Utils.createEvent(t[n],o);e.dispatchEvent(i)}}var a=[],o={},s=!1,u=!0,l=!1,d=null,c="",f="",p=e.originalNode.autoplay;o.options=t,o.id=e.id+"_"+t.prefix,o.mediaElement=e,mejs.Features.isiPhone&&e.originalNode.getAttribute("poster")&&(f=e.originalNode.getAttribute("poster"),e.originalNode.removeAttribute("poster"));for(var m=mejs.html5media.properties,v=0,g=m.length;v<g;v++)!function(t){var n=""+t.substring(0,1).toUpperCase()+t.substring(1);o["get"+n]=function(){if(null!==d){switch(t){case"currentTime":return d.getCurrentPosition();case"duration":return d.getDuration();case"volume":return d.getVolume();case"paused":return u;case"ended":return l;case"muted":return d.isMuted();case"buffered":return{start:function(){return 0},end:function(){return 0},length:1};case"src":return c;case"readyState":return 4}return null}return null},o["set"+n]=function(n){if(null!==d)switch(t){case"src":var i="string"==typeof n?n:n[0].src;c=i,N.remove(),(N=document.createElement("div")).id=o.id,N.className="fb-video",N.setAttribute("data-href",i),N.setAttribute("data-allowfullscreen","true"),N.setAttribute("data-controls","false"),e.originalNode.parentNode.insertBefore(N,e.originalNode),e.originalNode.style.display="none",r.load({lang:o.options.lang,id:o.id}),FB.XFBML.parse(),p&&d.play();break;case"currentTime":d.seek(n);break;case"muted":n?d.mute():d.unmute(),setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",o);e.dispatchEvent(t)},50);break;case"volume":d.setVolume(n),setTimeout(function(){var t=mejs.Utils.createEvent("volumechange",o);e.dispatchEvent(t)},50);break;case"readyState":var s=mejs.Utils.createEvent("canplay",o);e.dispatchEvent(s)}else a.push({type:"set",propName:t,value:n})}}(m[v]);for(var y=mejs.html5media.methods,b=0,h=y.length;b<h;b++)!function(e){o[e]=function(){if(null!==d)switch(e){case"play":return d.play();case"pause":return d.pause();case"load":return null}else a.push({type:"call",methodName:e})}}(y[b]);window["__ready__"+o.id]=function(){FB.Event.subscribe("xfbml.ready",function(t){if("video"===t.type&&o.id===t.id){e.fbPlayer=d=t.instance;var n=document.getElementById(o.id),r=n.offsetWidth,c=n.offsetHeight,f=["mouseover","mouseout"];o.setSize(r,c),e.originalNode.muted||d.unmute(),p&&d.play();for(var m=0,v=f.length;m<v;m++)n.addEventListener(f[m],function(t){var n=mejs.Utils.createEvent(t.type,o);e.dispatchEvent(n)});o.eventHandler={};for(var g=["startedPlaying","paused","finishedPlaying","startedBuffering","finishedBuffering"],y=0,b=g.length;y<b;y++){var h=g[y],N=o.eventHandler[h];void 0===N||null===N||mejs.Utils.isObjectEmpty(N)||"function"!=typeof N.removeListener||N.removeListener(h)}if(a.length)for(var E=0,w=a.length;E<w;E++){var k=a[E];if("set"===k.type){var _=k.propName,j=""+_.substring(0,1).toUpperCase()+_.substring(1);o["set"+j](k.value)}else"call"===k.type&&o[k.methodName]()}i(["rendererready","loadeddata","canplay","progress","loadedmetadata","timeupdate"]);var B=void 0;o.eventHandler.startedPlaying=d.subscribe("startedPlaying",function(){s||(s=!0),u=!1,l=!1,i(["play","playing","timeupdate"]),B=setInterval(function(){d.getCurrentPosition(),i(["timeupdate"])},250)}),o.eventHandler.paused=d.subscribe("paused",function(){u=!0,l=!1,i(["pause"])}),o.eventHandler.finishedPlaying=d.subscribe("finishedPlaying",function(){u=!0,l=!0,i(["ended"]),clearInterval(B),B=null}),o.eventHandler.startedBuffering=d.subscribe("startedBuffering",function(){i(["progress","timeupdate"])}),o.eventHandler.finishedBuffering=d.subscribe("finishedBuffering",function(){i(["progress","timeupdate"])})}})},c=n[0].src;var N=document.createElement("div");return N.id=o.id,N.className="fb-video",N.setAttribute("data-href",c),N.setAttribute("data-allowfullscreen","true"),N.setAttribute("data-controls",!!e.originalNode.controls),e.originalNode.parentNode.insertBefore(N,e.originalNode),e.originalNode.style.display="none",r.load({options:o.options.facebook,id:o.id}),o.hide=function(){o.pause(),d&&(N.style.display="none")},o.setSize=function(e){null===d||isNaN(e)||(N.style.width=e)},o.show=function(){d&&(N.style.display="")},o.destroy=function(){f&&e.originalNode.setAttribute("poster",f)},o}};mejs.Utils.typeChecks.push(function(e){return~e.toLowerCase().indexOf("//www.facebook")?"video/x-facebook":null}),mejs.Renderers.add(i)},{}]},{},[1]);
public/assets/mediaelement/renderers/vimeo.js DELETED
@@ -1,412 +0,0 @@
1
- /*!
2
- * MediaElement.js
3
- * http://www.mediaelementjs.com/
4
- *
5
- * Wrapper that mimics native HTML5 MediaElement (audio and video)
6
- * using a variety of technologies (pure JavaScript, Flash, iframe)
7
- *
8
- * Copyright 2010-2017, John Dyer (http://j.hn/)
9
- * License: MIT
10
- *
11
- */(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
12
- 'use strict';
13
-
14
- var VimeoApi = {
15
-
16
- promise: null,
17
-
18
- load: function load(settings) {
19
-
20
- if (typeof Vimeo !== 'undefined') {
21
- VimeoApi._createPlayer(settings);
22
- } else {
23
- VimeoApi.promise = VimeoApi.promise || mejs.Utils.loadScript('https://player.vimeo.com/api/player.js');
24
- VimeoApi.promise.then(function () {
25
- VimeoApi._createPlayer(settings);
26
- });
27
- }
28
- },
29
-
30
- _createPlayer: function _createPlayer(settings) {
31
- var player = new Vimeo.Player(settings.iframe);
32
- window['__ready__' + settings.id](player);
33
- },
34
-
35
- getVimeoId: function getVimeoId(url) {
36
- if (url === undefined || url === null) {
37
- return null;
38
- }
39
-
40
- var parts = url.split('?');
41
- url = parts[0];
42
- return parseInt(url.substring(url.lastIndexOf('/') + 1), 10);
43
- }
44
- };
45
-
46
- var vimeoIframeRenderer = {
47
-
48
- name: 'vimeo_iframe',
49
- options: {
50
- prefix: 'vimeo_iframe'
51
- },
52
-
53
- canPlayType: function canPlayType(type) {
54
- return ~['video/vimeo', 'video/x-vimeo'].indexOf(type.toLowerCase());
55
- },
56
-
57
- create: function create(mediaElement, options, mediaFiles) {
58
- var apiStack = [],
59
- vimeo = {},
60
- readyState = 4;
61
-
62
- var paused = true,
63
- volume = 1,
64
- oldVolume = volume,
65
- currentTime = 0,
66
- bufferedTime = 0,
67
- ended = false,
68
- duration = 0,
69
- vimeoPlayer = null,
70
- url = '';
71
-
72
- vimeo.options = options;
73
- vimeo.id = mediaElement.id + '_' + options.prefix;
74
- vimeo.mediaElement = mediaElement;
75
-
76
- var errorHandler = function errorHandler(error) {
77
- mediaElement.generateError('Code ' + error.name + ': ' + error.message, mediaFiles);
78
- };
79
-
80
- var props = mejs.html5media.properties,
81
- assignGettersSetters = function assignGettersSetters(propName) {
82
-
83
- var capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
84
-
85
- vimeo['get' + capName] = function () {
86
- if (vimeoPlayer !== null) {
87
- var value = null;
88
-
89
- switch (propName) {
90
- case 'currentTime':
91
- return currentTime;
92
- case 'duration':
93
- return duration;
94
- case 'volume':
95
- return volume;
96
- case 'muted':
97
- return volume === 0;
98
- case 'paused':
99
- return paused;
100
- case 'ended':
101
- return ended;
102
- case 'src':
103
- vimeoPlayer.getVideoUrl().then(function (_url) {
104
- url = _url;
105
- }).catch(function (error) {
106
- return errorHandler(error);
107
- });
108
- return url;
109
- case 'buffered':
110
- return {
111
- start: function start() {
112
- return 0;
113
- },
114
- end: function end() {
115
- return bufferedTime * duration;
116
- },
117
- length: 1
118
- };
119
- case 'readyState':
120
- return readyState;
121
- }
122
- return value;
123
- } else {
124
- return null;
125
- }
126
- };
127
-
128
- vimeo['set' + capName] = function (value) {
129
- if (vimeoPlayer !== null) {
130
- switch (propName) {
131
- case 'src':
132
- var _url2 = typeof value === 'string' ? value : value[0].src,
133
- videoId = VimeoApi.getVimeoId(_url2);
134
-
135
- vimeoPlayer.loadVideo(videoId).then(function () {
136
- if (mediaElement.originalNode.autoplay) {
137
- vimeoPlayer.play();
138
- }
139
- }).catch(function (error) {
140
- return errorHandler(error);
141
- });
142
- break;
143
- case 'currentTime':
144
- vimeoPlayer.setCurrentTime(value).then(function () {
145
- currentTime = value;
146
- setTimeout(function () {
147
- var event = mejs.Utils.createEvent('timeupdate', vimeo);
148
- mediaElement.dispatchEvent(event);
149
- }, 50);
150
- }).catch(function (error) {
151
- return errorHandler(error);
152
- });
153
- break;
154
- case 'volume':
155
- vimeoPlayer.setVolume(value).then(function () {
156
- volume = value;
157
- oldVolume = volume;
158
- setTimeout(function () {
159
- var event = mejs.Utils.createEvent('volumechange', vimeo);
160
- mediaElement.dispatchEvent(event);
161
- }, 50);
162
- }).catch(function (error) {
163
- return errorHandler(error);
164
- });
165
- break;
166
- case 'loop':
167
- vimeoPlayer.setLoop(value).catch(function (error) {
168
- return errorHandler(error);
169
- });
170
- break;
171
- case 'muted':
172
- if (value) {
173
- vimeoPlayer.setVolume(0).then(function () {
174
- volume = 0;
175
- setTimeout(function () {
176
- var event = mejs.Utils.createEvent('volumechange', vimeo);
177
- mediaElement.dispatchEvent(event);
178
- }, 50);
179
- }).catch(function (error) {
180
- return errorHandler(error);
181
- });
182
- } else {
183
- vimeoPlayer.setVolume(oldVolume).then(function () {
184
- volume = oldVolume;
185
- setTimeout(function () {
186
- var event = mejs.Utils.createEvent('volumechange', vimeo);
187
- mediaElement.dispatchEvent(event);
188
- }, 50);
189
- }).catch(function (error) {
190
- return errorHandler(error);
191
- });
192
- }
193
- break;
194
- case 'readyState':
195
- var event = mejs.Utils.createEvent('canplay', vimeo);
196
- mediaElement.dispatchEvent(event);
197
- break;
198
- default:
199
-
200
- break;
201
- }
202
- } else {
203
- apiStack.push({ type: 'set', propName: propName, value: value });
204
- }
205
- };
206
- };
207
-
208
- for (var i = 0, total = props.length; i < total; i++) {
209
- assignGettersSetters(props[i]);
210
- }
211
-
212
- var methods = mejs.html5media.methods,
213
- assignMethods = function assignMethods(methodName) {
214
- vimeo[methodName] = function () {
215
- if (vimeoPlayer !== null) {
216
- switch (methodName) {
217
- case 'play':
218
- paused = false;
219
- return vimeoPlayer.play();
220
- case 'pause':
221
- paused = true;
222
- return vimeoPlayer.pause();
223
- case 'load':
224
- return null;
225
- }
226
- } else {
227
- apiStack.push({ type: 'call', methodName: methodName });
228
- }
229
- };
230
- };
231
-
232
- for (var _i = 0, _total = methods.length; _i < _total; _i++) {
233
- assignMethods(methods[_i]);
234
- }
235
-
236
- window['__ready__' + vimeo.id] = function (_vimeoPlayer) {
237
-
238
- mediaElement.vimeoPlayer = vimeoPlayer = _vimeoPlayer;
239
-
240
- if (apiStack.length) {
241
- for (var _i2 = 0, _total2 = apiStack.length; _i2 < _total2; _i2++) {
242
- var stackItem = apiStack[_i2];
243
-
244
- if (stackItem.type === 'set') {
245
- var propName = stackItem.propName,
246
- capName = '' + propName.substring(0, 1).toUpperCase() + propName.substring(1);
247
-
248
- vimeo['set' + capName](stackItem.value);
249
- } else if (stackItem.type === 'call') {
250
- vimeo[stackItem.methodName]();
251
- }
252
- }
253
- }
254
-
255
- if (mediaElement.originalNode.muted) {
256
- vimeoPlayer.setVolume(0);
257
- volume = 0;
258
- }
259
-
260
- var vimeoIframe = document.getElementById(vimeo.id);
261
- var events = void 0;
262
-
263
- events = ['mouseover', 'mouseout'];
264
-
265
- var assignEvents = function assignEvents(e) {
266
- var event = mejs.Utils.createEvent(e.type, vimeo);
267
- mediaElement.dispatchEvent(event);
268
- };
269
-
270
- for (var _i3 = 0, _total3 = events.length; _i3 < _total3; _i3++) {
271
- vimeoIframe.addEventListener(events[_i3], assignEvents, false);
272
- }
273
-
274
- vimeoPlayer.on('loaded', function () {
275
- vimeoPlayer.getDuration().then(function (loadProgress) {
276
- duration = loadProgress;
277
- if (duration > 0) {
278
- bufferedTime = duration * loadProgress;
279
- if (mediaElement.originalNode.autoplay) {
280
- paused = false;
281
- ended = false;
282
- var event = mejs.Utils.createEvent('play', vimeo);
283
- mediaElement.dispatchEvent(event);
284
- }
285
- }
286
- }).catch(function (error) {
287
- errorHandler(error, vimeo);
288
- });
289
- });
290
- vimeoPlayer.on('progress', function () {
291
- vimeoPlayer.getDuration().then(function (loadProgress) {
292
- duration = loadProgress;
293
-
294
- if (duration > 0) {
295
- bufferedTime = duration * loadProgress;
296
- if (mediaElement.originalNode.autoplay) {
297
- var initEvent = mejs.Utils.createEvent('play', vimeo);
298
- mediaElement.dispatchEvent(initEvent);
299
-
300
- var playingEvent = mejs.Utils.createEvent('playing', vimeo);
301
- mediaElement.dispatchEvent(playingEvent);
302
- }
303
- }
304
-
305
- var event = mejs.Utils.createEvent('progress', vimeo);
306
- mediaElement.dispatchEvent(event);
307
- }).catch(function (error) {
308
- return errorHandler(error);
309
- });
310
- });
311
- vimeoPlayer.on('timeupdate', function () {
312
- vimeoPlayer.getCurrentTime().then(function (seconds) {
313
- currentTime = seconds;
314
- var event = mejs.Utils.createEvent('timeupdate', vimeo);
315
- mediaElement.dispatchEvent(event);
316
- }).catch(function (error) {
317
- return errorHandler(error);
318
- });
319
- });
320
- vimeoPlayer.on('play', function () {
321
- paused = false;
322
- ended = false;
323
- var event = mejs.Utils.createEvent('play', vimeo);
324
- mediaElement.dispatchEvent(event);
325
-
326
- var playingEvent = mejs.Utils.createEvent('playing', vimeo);
327
- mediaElement.dispatchEvent(playingEvent);
328
- });
329
- vimeoPlayer.on('pause', function () {
330
- paused = true;
331
- ended = false;
332
-
333
- var event = mejs.Utils.createEvent('pause', vimeo);
334
- mediaElement.dispatchEvent(event);
335
- });
336
- vimeoPlayer.on('ended', function () {
337
- paused = false;
338
- ended = true;
339
-
340
- var event = mejs.Utils.createEvent('ended', vimeo);
341
- mediaElement.dispatchEvent(event);
342
- });
343
-
344
- events = ['rendererready', 'loadedmetadata', 'loadeddata', 'canplay'];
345
-
346
- for (var _i4 = 0, _total4 = events.length; _i4 < _total4; _i4++) {
347
- var event = mejs.Utils.createEvent(events[_i4], vimeo);
348
- mediaElement.dispatchEvent(event);
349
- }
350
- };
351
-
352
- var height = mediaElement.originalNode.height,
353
- width = mediaElement.originalNode.width,
354
- vimeoContainer = document.createElement('iframe'),
355
- standardUrl = 'https://player.vimeo.com/video/' + VimeoApi.getVimeoId(mediaFiles[0].src);
356
-
357
- var queryArgs = ~mediaFiles[0].src.indexOf('?') ? '?' + mediaFiles[0].src.slice(mediaFiles[0].src.indexOf('?') + 1) : '';
358
- if (queryArgs && mediaElement.originalNode.autoplay && queryArgs.indexOf('autoplay') === -1) {
359
- queryArgs += '&autoplay=1';
360
- }
361
- if (queryArgs && mediaElement.originalNode.loop && queryArgs.indexOf('loop') === -1) {
362
- queryArgs += '&loop=1';
363
- }
364
-
365
- vimeoContainer.setAttribute('id', vimeo.id);
366
- vimeoContainer.setAttribute('width', width);
367
- vimeoContainer.setAttribute('height', height);
368
- vimeoContainer.setAttribute('frameBorder', '0');
369
- vimeoContainer.setAttribute('src', '' + standardUrl + queryArgs);
370
- vimeoContainer.setAttribute('webkitallowfullscreen', 'true');
371
- vimeoContainer.setAttribute('mozallowfullscreen', 'true');
372
- vimeoContainer.setAttribute('allowfullscreen', 'true');
373
- vimeoContainer.setAttribute('allow', 'autoplay');
374
-
375
- mediaElement.originalNode.parentNode.insertBefore(vimeoContainer, mediaElement.originalNode);
376
- mediaElement.originalNode.style.display = 'none';
377
-
378
- VimeoApi.load({
379
- iframe: vimeoContainer,
380
- id: vimeo.id
381
- });
382
-
383
- vimeo.hide = function () {
384
- vimeo.pause();
385
- if (vimeoPlayer) {
386
- vimeoContainer.style.display = 'none';
387
- }
388
- };
389
- vimeo.setSize = function (width, height) {
390
- vimeoContainer.setAttribute('width', width);
391
- vimeoContainer.setAttribute('height', height);
392
- };
393
- vimeo.show = function () {
394
- if (vimeoPlayer) {
395
- vimeoContainer.style.display = '';
396
- }
397
- };
398
-
399
- vimeo.destroy = function () {};
400
-
401
- return vimeo;
402
- }
403
- };
404
-
405
- mejs.Utils.typeChecks.push(function (url) {
406
- return (/(\/\/player\.vimeo|vimeo\.com)/i.test(url) ? 'video/x-vimeo' : null
407
- );
408
- });
409
-
410
- mejs.Renderers.add(vimeoIframeRenderer);
411
-
412
- },{}]},{},[1]);