Skip to content

Commit

Permalink
filters for audio/video waypoints
Browse files Browse the repository at this point in the history
fixes #83
  • Loading branch information
Bearded Avenger committed Aug 15, 2014
1 parent c178abd commit c77fb6c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion public/includes/components/component-audio.php
Expand Up @@ -36,6 +36,9 @@ function aesop_audio_shortcode($atts, $content = null) {
// loop
$loop = 'on' == $atts['loop'] ? 'true' : false;

// waypoint filter
$waypoint = apply_filters('aesop_audio_component_waypoint', 'bottom-in-view');

ob_start();

do_action('aesop_audio_before'); //action
Expand All @@ -46,7 +49,7 @@ function aesop_audio_shortcode($atts, $content = null) {
<script>
jQuery(document).ready(function(){
jQuery('#aesop-audio-<?php echo $unique;?>').waypoint({
offset: 'bottom-in-view',
offset: '<?php echo $waypoint;?>',
handler: function(direction){
jQuery('#aesop-audio-<?php echo $unique;?> .mejs-playpause-button button').trigger('click');

Expand Down
5 changes: 4 additions & 1 deletion public/includes/components/component-video.php
Expand Up @@ -64,13 +64,16 @@ function aesop_video_shortcode($atts, $content = null) {
// custom classes
$classes = function_exists('aesop_component_classes') ? aesop_component_classes( 'video', '' ) : null;

// waypoint filter
$waypoint = apply_filters('aesop_video_component_waypoint', 'bottom-in-view');

ob_start();

if ( 'on' == $atts['viewstart'] && 'self' == $atts['src'] ) { ?>
<script>
jQuery(document).ready(function(){
jQuery('#aesop-video-<?php echo $unique;?>').waypoint({
offset: 'bottom-in-view',
offset: '<?php echo $waypoint;?>',
handler: function(direction){
jQuery('#aesop-video-<?php echo $unique;?> .mejs-playpause-button button').trigger('click');
}
Expand Down

0 comments on commit c77fb6c

Please sign in to comment.