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.
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. |
// 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 { }
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]