Add practice controls to your lessons
Keep your existing video field. Add our script to your shared site layout and replace the player tag in your shared lesson template. Do each once; new lessons then work automatically.
No API key, per-video setup, new database field or video upload is needed.
-
Send us one lesson page address
Email support@stairway2fast.com with a published lesson URL. We check the site address and approve it, including any
wwwversion we find. One approval covers every lesson on that website.If you also use a separate teaching or staging subdomain, include one page address for it. We will tell you when the site is ready. You can send us your platform name and current player snippet if you want an exact replacement prepared for you.
-
Add one script to the shared site layout
Place this once in the common
<head>, or just before</body>. It handles player height, phones and lessons added after page load. If your current YouTube embeds wait for your site's privacy choice, use the same choice for Practice Mode; see the example below.<script defer src="https://stairway2fast.com/embed/loader.js"></script> -
Replace the player in the shared lesson template
Keep the video field your site already uses. It can contain a YouTube ID or full YouTube link. For example:
<!-- Before --> <iframe src="https://www.youtube.com/embed/{{lesson.youtubeId}}"></iframe> <!-- After --> <div data-s2f-video="{{lesson.youtubeId}}"></div>{{lesson.youtubeId}}is an example of your existing template variable. Use your own platform's variable syntax and normal HTML attribute escaping. Edit the shared template, not each lesson.The player opens paused in Full at 1×. When the visitor's Loops list for that video is empty, Practice Mode reads creator-written chapters from the YouTube description and adds them as named loops.
If your site wraps videos in a fixed 16:9 box, replace that box too. The practice controls need space below the video. See the template example.
Privacy check before publishing
The player contacts YouTube when it appears, before playback. Practice Mode also loads from Stairway2Fast and checks your website's origin for access. Saved loops and practice statistics stay in the visitor's browser storage when available; they are not sent to a Stairway2Fast account.
Check whether your current privacy notice covers Stairway2Fast and this browser storage, and update it if needed. Your website is responsible for its visitor notices and any consent process that applies. Website approval grants access to Practice Mode; it is not a visitor privacy choice. There is no additional agreement button inside our player.
Check one published lesson
Open it on the approved website. When the player appears, press Play and try the Loop and speed buttons. If the video has chapters, select one on the timeline or in Loops. If a page has two lessons, starting the next one should pause the first. Check a lesson on a phone to see the video and controls together.
If you see an approval message, an empty player or a sizing problem, send us the lesson URL and a screenshot. We will check the website grant and integration first.
Optional settings
Replace a fixed-height video wrapper
A 16:9 wrapper with clipped overflow can hide the controls below the picture. Keep the width of your lesson column and let the loader size the player vertically.
<!-- Before -->
<div class="video-16-by-9" style="aspect-ratio:16/9; overflow:hidden">
<iframe src="https://www.youtube.com/embed/{{lesson.youtubeId}}"></iframe>
</div>
<!-- After, in the same lesson column -->
<div data-s2f-video="{{lesson.youtubeId}}"></div>
Use a light control panel
The control panel defaults to dark. Use data-theme="light" on a lesson's placeholder to match a light page.
<div data-s2f-video="{{lesson.youtubeId}}" data-theme="light"></div>
To set the default for the whole site, place data-theme="light" on the shared loader script. A theme on the lesson's own placeholder takes precedence.
Open on a preset loop
Set data-start and data-end in seconds. This example opens in Loop from 0:24 to 0:33. Visitors can adjust the boundaries or switch to Full.
<div data-s2f-video="{{lesson.youtubeId}}"
data-start="24" data-end="33"></div>
Choose the starting speed
Set data-speed to the desired rate. Use it on its own or combine it with a preset loop. Visitors can adjust the speed in the player.
<div data-s2f-video="{{lesson.youtubeId}}" data-speed="0.85"></div>
Your current YouTube player waits for site consent?
Leave the loader from step 2 in place. Add data-s2f-video when your existing consent manager allows the YouTube player. On withdrawal, remove the source attribute. The loader removes its player and playback stops.
<!-- In the shared lesson template -->
<div data-s2f-pending-video="{{lesson.youtubeId}}"></div>
<!-- Once in the shared site layout -->
<script>
function allowPracticeVideos() {
for (const host of document.querySelectorAll('[data-s2f-pending-video]')) {
host.dataset.s2fVideo = host.dataset.s2fPendingVideo;
}
}
function withdrawPracticeVideos() {
for (const host of document.querySelectorAll('[data-s2f-pending-video]')) {
host.removeAttribute('data-s2f-video');
}
}
// Call these from your existing consent manager, including its saved
// choice and after your site adds new lesson cards.
</script>
Use your platform's variable syntax and HTML attribute escaping. If you use a direct Practice Mode <iframe> instead of the placeholder, delay creating that iframe until the same site-level choice allows it. Your site's own privacy notice should identify Stairway2Fast and YouTube/Google. The player’s information button opens Stairway2Fast Privacy and YouTube Terms links. Read our Website Practice Mode API privacy notice for what this player sends and stores.
Using a public Stairway2Fast share link?
Use the public share URL as the lesson source. The player opens its first passage at the shared speed and lists any other shared passages beside the visitor's own loops. Public YouTube shares work here; friend-only shares do not.
<div data-s2f-share="{{lesson.publicShareUrl}}"></div>
If your site waits for consent, follow the example above with data-s2f-pending-share and data-s2f-share. A public share also prepares a YouTube player when it appears.
Using your own video or audio file?
Direct video and audio files are supported by the production player. Use the same script above and one shared template change:
<!-- Video file -->
<div data-s2f-src="{{lesson.fileUrl}}"></div>
<!-- Audio file -->
<div data-s2f-src="{{lesson.fileUrl}}" data-s2f-type="audio"></div>
Use a direct, browser-playable HTTPS file link, such as MP4 or MP3. If the link expires, add data-s2f-id="{{lesson.id}}" using your existing stable lesson ID so saved loops survive link renewal. If the file does not load, send us one working lesson page; we will check the media host's access rules with you.
Give a class several passages from the same MP4
On your staff lesson template, add data-s2f-author to the file placeholder. Open the staff page, load the video, mark the start and end of a passage, choose its speed, then open Loops and save it with a name. Repeat for each passage.
<!-- Staff template -->
<div data-s2f-src="{{lesson.fileUrl}}" data-s2f-id="{{lesson.id}}" data-s2f-author></div>
In Loops → Prepare lesson passages, select up to ten passages and copy the settings. Save the JSON in your lesson record. Put that field on the student template using your CMS's HTML attribute escaping. For a hand-written lesson, paste the copied settings between single quotes as shown below.
<!-- Student template, with sample settings -->
<div data-s2f-src="{{lesson.fileUrl}}" data-s2f-id="{{lesson.id}}"
data-s2f-passages='[{"name":"Intro","startSec":3,"endSec":12,"speed":0.75},{"name":"Chorus","startSec":24,"endSec":33,"speed":1}]'></div>
Publish the lesson and share your usual course URL. Students open in Full at 1× unless you set an opening preset. Choosing a lesson passage applies its range and speed. Their own saved loops stay in their browser. When renewing a signed file URL, keep the lesson ID and passage settings on the same recording.
Set a site-wide referral code
Add your assigned referral code to the shared loader script. The code is carried by the Powered by Stairway2Fast link.
<script defer src="https://stairway2fast.com/embed/loader.js"
data-ref="your-code"></script>