RBA Cash Rate: 4.35% · 1AUD = 0.67 USD · Inflation: 4.1%  
Leading Digital Marketing Experts | 1300 235 433 | Aggregation Enquires Welcome | Book Appointment
Example Interest Rates: Home Loan Variable: 5.38% (6.14%*) • Home Loan Fixed: 5.44% (6.26%*) • Fixed: 5.44% (6.26%*) • Variable: 5.38% (6.14%*) • Investment IO: 5.69% (6.52%*) • Investment PI: 5.49% (5.98%*)

Add Peeks (Keek) Video to Your Website with WordPress Shortcode or PHP

Add Peeks (Keek) Video to Your Website with WordPress Shortcode or PHP

Peeks (formerly Keek) formerly described themselve as "the Twitter for video", "Instagram of video" and a "micro version of YouTube". Prior to the brand-pivot to Peeks, those posting content to the social sewer focused on short, personal video uploads of up to 36 seconds in length. Given the spontaneous nature of the platform, content is usually uploaded directly from a webcam or smartphone camera (seemingly without any thought of what one will do when they hit the record button).

Note: This service is no longer active or supported. Post remains for reference only.

Unlike many of the professional vloggers floating around on YouTube, early Keeks content is unpolished - but it's also far quicker and reactive than anything you'll find elsewhere. In my own perusal of the platform, I was challenged to find content that was manufactured by anybody outside of the 8-14 year old female age demographic... and the videos serves to illustrate much of what's wrong with the new 12-year-old-bikini-clad-half-naked generation of social media.

The word "Keek" comes from Middle English and means "peep surreptitiously", especially a quick one... describing my own evaluation of the platform.

In November of 2016 Keek became 'Peeks ', an ecommerce enabled live-streaming platform. Keek reborn (now residing at k.to) provides a live-streaming mobile application that facilitates both voluntary and forced 'tips' to view content. The pivot caused a massive surge in the price of stock (peaking in late November, 2016) but, at the time of writing, it's on the back-end of a slow decline.

As of July, 2012, 85% of the Keek community were between the ages of 13 and 25, with 69% female engagement, and two-thirds of those users were active during that month. Source: Wikipedia . It's somewhat of a confronting experience perusing the network.

This post will show you how to include Keek Peeks content into your WordPress website with shortcode. A PHP version is also available for download.

The Result

Unlike the default code provided by Peeks, our shortcode function is responsive to all devices. The shortcode of [keek v="SXRseab"] (or [keek v="https://www.k.to/keek/SXRseab"]) will return the following video.

Note: This service is no longer active or supported.

Some of the older Keek videos provided embed code of 900x600 (a ratio of 1/1.5). This produces black bars to the top and bottom of the video, so we've altered it by default to render the video with a ratio or 1/1.7, the same as YouTube. If you choose to restore the default scaling, use w="0" in your shortcode, or alter the function for default use. Most of the new content seems to be consistent with other video websites.

Shortcode Attributes

v

v is the video URL or video ID. It's best to always use the video ID in case the URL structure changes in the future. If that becomes the case, you'll obviously only have to alter the shortcode once for global changes.

width

The width is the width of your video. If you provide width we'll automatically scale height. If you don't like the wide YouTube video container you can use w="0" in your shortcode to get the default and undesirable Keek video container.

height

If the width is defined, you don't have to provide a height - we'll scale it for you.

autoplay

Use autoplay="1" if you want the video to start automatically.

mute

Use mute="1" if you want to mute sound when the video starts playing.

controls

Use controls="0" if you want to disable default player controls.

loop

Use loop="1" if you want to loop the video over and over.

w

The w defines the type of scale. By default we'll scale the video to 1.77 which is the same as YouTube. If you want the larger height, and larger scale (1/1.5), use w="0", or hardcode it into the shortcode function.

The Code

Copy and paste the WordPress function into your theme's functions.php file or, if you sensibly have one installed, your custom functions plugin. You may optionally download and install our plugin from the bottom of of the page.

1
<?php 
2
/*
3
 Add Keek Videos to Your Website with WordPress Shortcode or PHP
4
 http://www.beliefmedia.com/keek-videos-wordpress
5
*/
6
 
7
function beliefmedia_keek_video($atts) {
8
  $atts = shortcode_atts(array(
9
    'v'  => '',
10
    'width'  => '600',
11
    'height' => false,
12
    'height_correction' => 45,
13
    'autoplay' => '0',
14
    'mute' => '0',
15
    'controls' => '1',
16
    'loop' => '0',
17
    'w' => false,
18
    'align' => 'center'
19
  ), $atts);
20
 
21
  /* height */
22
  if ( ($atts['height'] === false) && ($atts['w'] !== false) ) $height = round($atts['width'] / 1.5);
23
  else if ( ($atts['height'] === false) && ($atts['w'] === false) ) $height = round($atts['width'] / 1.777);
24
  else $height = $atts['height'];
25
 
26
  $style = '
27
<style scoped>
28
    .embed-container {
29
      position: relative;
30
      padding-bottom: ' . round(($height / $atts['width']) * 100) . '%;
31
      height: 0;
32
      overflow: hidden;
33
      max-width: ' . $atts['width'] . 'px;
34
      margin: 0px auto;
35
  }
36
 
37
    .embed-container iframe {
38
      position: absolute;
39
      top: 0px;
40
      left: 0px;
41
      width: 100%;
42
      height: 100%;
43
      padding-bottom: 0;
44
    }
45
  </style>
46
 
47
';
48
 
49
  /* Video ID */
50
  if (strripos($atts['v'], 'http') !== false) list($u, $nm, $v) = explode('/', parse_url($atts['v'], PHP_URL_PATH));
51
  else $v = $atts['v'];
52
 
53
  /* Embed code */
54
  $embed = '<iframe src="https://www.k.to/keek/' . $v . '/embed?autoplay=' . $atts['autoplay'] . '&mute=' . $atts['mute'] . '&controls=' . $atts['controls'] . '&loop=' . $atts['loop'] . '" width="' . $atts['width'] . '" height="' . $height . '" allowfullscreen></iframe>';
55
 
56
 /* Responsive iframe */
57
 return '<div>' . $style . '<div class="embed-container">' . $embed . '</div>
58
</div>';
59
}
60
add_shortcode('keek', 'beliefmedia_keek_video');

If you require shortcode to work in a sidebar widget, you'll have to enable the functionality with a filter. If you're using our custom functions plugin, you'll have that feature enabled by default.

At the time of writing, the Keek developer website had no content and was instead populated with 'Lorem ipsum' text. When they provide more information, we'll provide more features.

■ ■ ■

 
Download our complimentary 650-page guide on marketing for mortgage brokers. We'll show you exactly how we generate billions in volume for our clients.
Finance Guide, Cropped Top and Bottom
  Timezone: 1 · [ CHANGE ]

RELATED READING

Like this article?

Share on Facebook
Share on Twitter
Share on Linkdin
Share on Pinterest

Leave a comment