|
| 1 | +# Embedded player |
| 2 | + |
| 3 | +TypeType provides a dedicated player route for embedding YouTube videos without the |
| 4 | +rest of the watch page. |
| 5 | + |
| 6 | +## URL format |
| 7 | + |
| 8 | +Use the YouTube video identifier after `/embed/`: |
| 9 | + |
| 10 | +```text |
| 11 | +https://your-instance.example/embed/VIDEO_ID |
| 12 | +``` |
| 13 | + |
| 14 | +The identifier is the 11-character value after `v=` in a regular YouTube watch URL. |
| 15 | +For example, `https://www.youtube.com/watch?v=dQw4w9WgXcQ` becomes |
| 16 | +`/embed/dQw4w9WgXcQ`. |
| 17 | + |
| 18 | +## Start position and autoplay |
| 19 | + |
| 20 | +| Parameter | Value | Behavior | |
| 21 | +| --- | --- | --- | |
| 22 | +| `t` | Seconds or a duration | Start position | |
| 23 | +| `start` | Seconds or a duration | Alias for `t` | |
| 24 | +| `time_continue` | Seconds or a duration | Invidious-compatible alias for `t` | |
| 25 | +| `autoplay` | `1` | Request autoplay | |
| 26 | + |
| 27 | +Durations can combine hours, minutes, and seconds, such as `1h30m15s`. When several |
| 28 | +start parameters are present, TypeType uses `t`, then `start`, then `time_continue`. |
| 29 | +Invalid or negative values start from the beginning. |
| 30 | + |
| 31 | +```text |
| 32 | +/embed/dQw4w9WgXcQ?t=90 |
| 33 | +/embed/dQw4w9WgXcQ?start=1m30s |
| 34 | +/embed/dQw4w9WgXcQ?time_continue=45&autoplay=1 |
| 35 | +``` |
| 36 | + |
| 37 | +Autoplay remains subject to the browser's media policy. A browser can require a user |
| 38 | +gesture before starting audio. |
| 39 | + |
| 40 | +## Add an iframe |
| 41 | + |
| 42 | +```html |
| 43 | +<iframe |
| 44 | + src="https://your-instance.example/embed/dQw4w9WgXcQ?autoplay=1" |
| 45 | + title="TypeType video player" |
| 46 | + allow="autoplay; fullscreen; picture-in-picture" |
| 47 | + allowfullscreen |
| 48 | + loading="lazy" |
| 49 | +></iframe> |
| 50 | +``` |
| 51 | + |
| 52 | +Give the iframe an explicit responsive size in the surrounding page. For example: |
| 53 | + |
| 54 | +```css |
| 55 | +.video-embed { |
| 56 | + width: 100%; |
| 57 | + aspect-ratio: 16 / 9; |
| 58 | + border: 0; |
| 59 | +} |
| 60 | +``` |
| 61 | + |
| 62 | +Add `class="video-embed"` to the iframe when using this example. |
| 63 | + |
| 64 | +## Accounts, settings, and guest access |
| 65 | + |
| 66 | +Opening an embed URL directly in a browser tab can reuse the current TypeType account |
| 67 | +and player settings. Inside an iframe, playback is anonymous and does not read the |
| 68 | +embedding site's TypeType session or settings. |
| 69 | + |
| 70 | +The instance must therefore allow guest access for iframe playback. An administrator |
| 71 | +can enable **Allow guest mode** from the TypeType administration settings. When guest |
| 72 | +access is disabled, the embed shows a dedicated message with a link to the normal |
| 73 | +watch page instead of attempting playback. |
| 74 | + |
| 75 | +The embed also shows the same unavailable, scheduled, and members-only states as the |
| 76 | +watch page. Temporary loading failures provide a retry action when retrying is safe. |
0 commit comments