Register | Sign In


Understanding through Discussion


EvC Forum active members: 38 (9288 total)
5 online now:
Newest Member: Sabbathbreaker
Post Volume: Total: 924,037 Year: 779/3,580 Month: 188/163 Week: 82/72 Day: 42/23 Hour: 0/4


Thread  Details

Email This Thread
Newer Topic | Older Topic
  
Author Topic:   Please Explain Again How to Embed YouTube Videos
dwise1
Member
Posts: 6451
Joined: 05-02-2006
Member Rating: 6.3


Message 1 of 9 (923375)
07-04-2025 5:45 PM


Of late I have found using the utube to be hit-or-miss, with the misses becoming increasingly more frequent that the hits. Pursuant my most recent failure in Message 287, Admin corrected my failed attempt.
Here is my failed attempt: [utube=2e9IRdEIM-0&t=188s]
which yields:
Your corrected form is: [utube=2e9IRdEIM-0,t=2382,center]
giving us
My question is: What is the syntax for the utube tag?
In particular, where did you get that t parameter from? The video's question-parameter includes &t=188s, so where did your t parameter of 2382 come from?

Replies to this message:
 Message 2 by Admin, posted 07-04-2025 8:44 PM dwise1 has replied

  
Admin
Director
Posts: 13214
From: EvC Forum
Joined: 06-14-2002


Message 2 of 9 (923376)
07-04-2025 8:44 PM
Reply to: Message 1 by dwise1
07-04-2025 5:45 PM


You have two syntax options with the [utube] code:
  1. Use the entire YouTube video URL, e.g.:
    [utube=https://www.youtube.com/watch?v=2e9IRdEIM-0&t=2382s]
    Which yields this:
  2. Use the local syntax for the [utube] code, e.g.:
    [utube=2e9IRdEIM-0,t=2382,center]
    Which yields this, the only difference being that I centered it:

The documentation can be found here: [utube] help
I just noticed that the documentation fails to mention that the default units for the time is seconds.

--Percy
EvC Forum Director

This message is a reply to:
 Message 1 by dwise1, posted 07-04-2025 5:45 PM dwise1 has replied

Replies to this message:
 Message 5 by dwise1, posted 07-05-2025 8:01 PM Admin has not replied

  
Minnemooseus
Member
Posts: 4023
From: Duluth, Minnesota, U.S. (West end of Lake Superior)
Joined: 11-11-2001


Message 3 of 9 (923378)
07-04-2025 9:45 PM


I always just use the youtube supplied embed process
<iframe width="560" height="315" src="https://www.youtube.com/embed/2e9IRdEIM-0?si=16uuY8zlEAgX3_p2" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
gets
Moose

Replies to this message:
 Message 4 by Admin, posted 07-05-2025 8:09 AM Minnemooseus has seen this message but chosen not to reply

  
Admin
Director
Posts: 13214
From: EvC Forum
Joined: 06-14-2002


Message 4 of 9 (923380)
07-05-2025 8:09 AM
Reply to: Message 3 by Minnemooseus
07-04-2025 9:45 PM


Re: I always just use the youtube supplied embed process
Here is the translation of [utube=2e9IRdEIM-0,t=2382,center] into HTML (the linefeeds must be removed before attempting to use this as is because they become translated into <br>):
<iframe width="599"
        height="337"
        src="https://www.youtube.com/embed/2e9IRdEIM-0?start=2382"
        frameborder="0"
        allowfullscreen>
</iframe>

It looks like the YouTube-provided embedding has picked up a few more attributes since I first implemented the [utube] code.

--Percy
EvC Forum Director

This message is a reply to:
 Message 3 by Minnemooseus, posted 07-04-2025 9:45 PM Minnemooseus has seen this message but chosen not to reply

  
dwise1
Member
Posts: 6451
Joined: 05-02-2006
Member Rating: 6.3


Message 5 of 9 (923383)
07-05-2025 8:01 PM
Reply to: Message 2 by Admin
07-04-2025 8:44 PM


You have two syntax options with the [utube] code:
  1. Use the entire YouTube video URL, e.g.:
    [utube=https://www.youtube.com/watch?v=2e9IRdEIM-0&t=2382s]
Actually, that is how I used to do it, but then it stopped working so you gave me the corrected format:
[utube=2e9IRdEIM-0&t=2382s]
But now even that doesn't work anymore. Or at least it's failing with increasing frequency making the entire evolution a crap shoot.
OK, so maybe whatever you had changed before to break using the entire URL has been fixed, so I tried it again while working on a reply:
[utube=https://www.youtube.com/shorts/Dr0QK_hGQ-8]
And I get failure yet again:
Whiskey-Tango-Foxtrot-Mike? ("WTF, man?")
Microsoft Edge on Windows 10, BTW, though since your examples worked that shouldn't have any bearing on this matter.

This message is a reply to:
 Message 2 by Admin, posted 07-04-2025 8:44 PM Admin has not replied

Replies to this message:
 Message 6 by nwr, posted 07-05-2025 10:13 PM dwise1 has not replied
 Message 7 by nwr, posted 07-05-2025 10:20 PM dwise1 has replied
 Message 9 by Percy, posted 07-06-2025 7:51 AM dwise1 has not replied

  
nwr
Member
Posts: 6550
From: Geneva, Illinois
Joined: 08-08-2005


Message 6 of 9 (923384)
07-05-2025 10:13 PM
Reply to: Message 5 by dwise1
07-05-2025 8:01 PM


However, this seems to work:
[utube=Dr0QK_hGQ-8]

Fundamentalism - the anti-American, anti-Christian branch of American Christianity

This message is a reply to:
 Message 5 by dwise1, posted 07-05-2025 8:01 PM dwise1 has not replied

  
nwr
Member
Posts: 6550
From: Geneva, Illinois
Joined: 08-08-2005


Message 7 of 9 (923385)
07-05-2025 10:20 PM
Reply to: Message 5 by dwise1
07-05-2025 8:01 PM


Another test:
Works fine. I took your code, and changed the "&" to "," (which seemed to be what Admin suggested).

Fundamentalism - the anti-American, anti-Christian branch of American Christianity

This message is a reply to:
 Message 5 by dwise1, posted 07-05-2025 8:01 PM dwise1 has replied

Replies to this message:
 Message 8 by dwise1, posted 07-06-2025 1:11 AM nwr has seen this message but chosen not to reply

  
dwise1
Member
Posts: 6451
Joined: 05-02-2006
Member Rating: 6.3


Message 8 of 9 (923386)
07-06-2025 1:11 AM
Reply to: Message 7 by nwr
07-05-2025 10:20 PM


What Admin said and what I was testing was to use the entire URL. In addition, since the URL used a subdirectory, shorts, I thought that would be necessary (though apparently not).
At least I now have alternatives to use, which ultimately was what I needed.

This message is a reply to:
 Message 7 by nwr, posted 07-05-2025 10:20 PM nwr has seen this message but chosen not to reply

  
Percy
Member
Posts: 23660
From: New Hampshire
Joined: 12-23-2000
Member Rating: 6.8


Message 9 of 9 (923387)
07-06-2025 7:51 AM
Reply to: Message 5 by dwise1
07-05-2025 8:01 PM


dwise1 writes in Message 5:
[utube=2e9IRdEIM-0&t=2382s]

But now even that doesn't work anymore. Or at least it's failing with increasing frequency making the entire evolution a crap shoot.
If I suggested this somewhere then I made a typo. You can either use a complete YouTube URL like this:
[utube=https://www.youtube.com/watch?v=2e9IRdEIM-0&t=2382s]
Or you can use the [utube] dBCode with local options, where the options require commas as separators:
[utube=2e9IRdEIM-0,t=2382s]
Sometimes when I'm mucking around in the text processing code for one of the dBCodes I'll think to myself, "Who really cares what the separator is," and I'll get more expansive about the separator for that dBCode as long as the particular separator doesn't matter, but I haven't documented that.
But there's a downside. Sometimes when you ask yourself, "Is the separator a comma or a semicolon or an ampersand or something else?", you'll pick one, it'll work, and you'll be happy you were able to remember. Then it won't work with another dBcode if it wasn't comma. I should allow use of a consistent set of separators across all dBCodes at some point. Unfortunately this isn't a high priority, so you're best off using comma as the separator.
--Percy

This message is a reply to:
 Message 5 by dwise1, posted 07-05-2025 8:01 PM dwise1 has not replied

  
Newer Topic | Older Topic
Jump to:


Copyright 2001-2023 by EvC Forum, All Rights Reserved

™ Version 4.2
Innovative software from Qwixotic © 2026