Codex / mycred/core / Shortcodes / mycred_video


This shortcode is used to embed YouTube videos via IFRAME in order to allow us to award points for users who view the video. Videos that are embedded without using this shortcode can not award points for viewing.

Requires the “Points for watching videos” hook to be enabled.

If you select to reward users using the “Interval” logic, no badges, ranks or notifications will be given to the user for watching the video! If the user gains enough points to reach a new rank / earn a badge, these will be given to the user first when they have gained points after they finished watching a video!

Users can only get points for watching videos once per video!

Available since version 1.3

Shortcode Attributes

Attribute Type Required Default Description
id string Yes - The video ID.
width int No 560 The embedded video width. Only numeric values without % or px.
height int No 315 The embedded video height. Only numeric values without % or px.
amount int or float No - The amount of points to award / deduct from users for viewing if you do not want to use the amount you set in your hooks settings.
logic string No - The award logic to use if you do not want to use the logic you set in your hooks settings.. Accepted values are: "play", "full" or "interval".
interval string No - The interval in seconds to use if you selected logic to be "interval". Should not be used if you want to use your default hook settings.
ctype string No MYCRED_DEFAULT_TYPE_KEY The point type to payout. Should not be used if you only have one point type installed.

CSS Styling

// Outer wrap
div.mycred-video-wrapper { }

// Movie box
div.mycred-video-wrapper>div { }

// YouTube video wrap { }

// YouTube video iframe iframe { }

// Vimeo video wrap
div.mycred-video-wrapper.vimeo-video { }

// Vimeo video iframe
div.mycred-video-wrapper.vimeo-video iframe { }

// Update notice
div.mycred-video-wrapper div.mycred-video-update-box { }


Example 1: Award 5 points for every 15 seconds watched of the video with the ID ``FSyAehMdpyI``

[mycred_video id="FSyAehMdpyI" logic="interval" amount=5 interval=15]

Last edited August 12, 2016