=== LoopTube Embed ===
Contributors: looptube
Tags: youtube, embed, music, practice, looper
Requires at least: 5.9
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embed a YouTube looper in posts and pages: readers can loop any section and slow it down to practise.

== Description ==

LoopTube Embed turns LoopTube links into an interactive YouTube player. Readers can loop a section, slow it down (25–200%) without changing the pitch, and jump between named sections, all without leaving your page.

It's built for music teachers, tutorial sites and anyone who posts YouTube lessons: set the loop points and tempo once on [LoopTube](https://www.looptube.xyz), paste the link, and every reader gets the same practice player.

**Three ways to embed**

* Paste a LoopTube link on its own line in the block editor or classic editor.
* Add the **LoopTube** block (search "LoopTube" in the inserter) and paste the link.
* Use the shortcode: `[looptube url="https://www.looptube.xyz/loop?vid=VIDEO_ID&start=10&end=30"]` or `[looptube id="VIDEO_ID" start="10" end="30" tempo="75"]` (tempo is a percentage, 25–200).

Links that work: `looptube.xyz/loop?vid=…`, `looptube.xyz/embed/VIDEO_ID…` and `looptube.xyz/?vid=…`, including multi-section links made with the [section builder](https://www.looptube.xyz/create).

The player resizes itself to fit its content, never autoplays, and works on phones.

= External service =

This plugin embeds content from LoopTube (https://www.looptube.xyz), a third-party service. When a post contains a LoopTube link, WordPress requests the embed code from `https://www.looptube.xyz/api/oembed` (sending the LoopTube link and the width your theme allows) and caches it. Visitors' browsers then load the player from `https://www.looptube.xyz/embed/…`, which plays the video through YouTube.

* LoopTube terms: https://www.looptube.xyz/terms
* LoopTube privacy policy: https://www.looptube.xyz/privacy
* YouTube terms: https://www.youtube.com/t/terms

== Installation ==

1. Install and activate the plugin from Plugins → Add New (search "LoopTube Embed"), or upload the zip.
2. Make a loop on https://www.looptube.xyz and copy its link.
3. Paste the link on its own line in a post. That's it.

== Frequently Asked Questions ==

= Do I need an account or API key? =

No. LoopTube embeds are free and need no key.

= Can I set the loop, tempo and sections in advance? =

Yes. Everything in the LoopTube link (start, end, tempo, named sections, theme) carries into the embed. Build multi-section links at https://www.looptube.xyz/create.

= Does it autoplay? =

No. Readers press Play.

= Why do I need a plugin? Can't I paste the iframe? =

You can paste the iframe into a Custom HTML block. The plugin makes plain links work, which is easier and survives editor changes, and it sizes the player to fit.

== Changelog ==

= 1.0.0 =
* First release: oEmbed provider for LoopTube links, LoopTube block, [looptube] shortcode and auto-height.
