mycred_video
Description
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.
If you want to customize the layout of each row, you can create your own template and wrap this shortcode around it. This way, your html template will be used for each user row. Supports the use of shortcodes and user related template tags.
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 | 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 div.mycred-video-wrapper.youtube-video { } // YouTube video iframe div.mycred-video-wrapper.youtube-video 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 { }
Examples
Example 1: Basic usage. Will use the logic you set in your hook.
[mycred_video id="Kt4P2txrcRA"]
Example 2: Award 5 points for every 15 seconds watched of the video with the ID “FSyAehMdpyI“
[mycred_video id="Kt4P2txrcRA" logic="interval" amount=5 interval=15]
Example 3: Award 20 points as soon as a user starts watching a Vimeo video. (Requires the myCRED Video premium add-on).
[mycred_video id="197443255" logic="play" amount=20]