Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Chris

    (@zenation)

    Hi,

    About 2:
    This could be placed inside your template file(s):

    <?php
    /**
     * Only execute this code when the plugin is activated.
     */
    if( class_exists( 'RelatedYouTubeVideos_API' ) ) {
    
      $RYTV     = new RelatedYouTubeVideos_API();
    
      $args     = $RYTV->validateConfiguration(
        array(
          'orderBy'     => 'relevance',
          'max'         => 1,
          'exact'       => false,
          'relation'    => 'keywords',
          'terms'       => 'ministry of silly walks',
          'width'       => 400,
          'height'      => 300
        )
      );
    
      $results  = $RYTV->searchYouTube( $args );
    
      $html     = $RYTV->displayResults( $results, $args );
    
      echo $html;
    
    }
    ?>

    About 1:
    That’s also been requested by someone else. So I guess I will implement at least the option to show only the images and load the embed code only when clicked on or something like that. The “problem” is that it would require some additional javascript to do the replacing.

    I’ll get back to you when I’ve investigated this any further.

    Plugin Author Chris

    (@zenation)

    I’ve added another attribute (‘preview’) that, set to ‘true’ will display thumbnail images and only load the video (+ autoplay it) when such a thumbnail has been clicked.

    [relatedYouTubeVideos ... preview="true"]

    As I said, this requires Javascript to be enabled in user’s browser. But I guess that’s nothing to worry about anymore these days.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘improvements needed’ is closed to new replies.