New [embed]...[/embed] BBCode

Open for any sort of non-technical discussion regarding EVs
Post Reply
User avatar
weber
Site Admin
Posts: 2601
Joined: Fri, 23 Jan 2009, 17:27
Real Name: Dave Keenan
Location: Brisbane
Contact:

New [embed]...[/embed] BBCode

Post by weber » Fri, 27 Sep 2019, 10:21

As an alternative to the long-standing [tube]...[/tube] BBCode, we now have the [embed]...[/embed] BBCode. This allows you to embed videos from other sources in addition to YouTube, e.g. Vimeo, and allows you to add an optional start time and/or end time, in seconds. For example:

[embed]https://www.youtube.com/embed/Z_oRZqAamP4?start=83&end=86[/embed]

results in this 3 second video:

One of the fathers of MeXy the electric MX-5, along with Coulomb and Newton (Jeff Owen).

User avatar
coulomb
Site Admin
Posts: 3720
Joined: Thu, 22 Jan 2009, 20:32
Real Name: Mike Van Emmerik
Location: Brisbane
Contact:

Re: New [embed]...[/embed] BBCode

Post by coulomb » Wed, 02 Oct 2019, 09:23

I thought I'd add to Weber's post above by distilling an email he kindly sent to me some time ago, with the rules for constructing an embedded YouTube video.
  • The URL has to start with https://youtube.com/embed/video-id (where video-id is the unique code for the video; in Weber's example above it is "Z_oRZqAamP4" without the quotes). Often, non-embedded URLs will contain ?v=video-id .
  • It can't be a youtu.be address; replace that part with youtube.com .
  • It can optionally be followed with ?start=start-time (e.g. ?start=83 in Weber's example above). Start-time is in seconds.
  • It can optionally be followed with &end=end-time, also in seconds. Note that only the first option in a URL starts with the question mark; all others follow an ampersand. You can have an end time without a start time. Obviously, if the end time is omitted, the video will play to the end and stop with the usual suggestions for what to play next.
  • To avoid having to do the arithmetic to get seconds, you can pause the video at the desired start point and use the context menu on the video and choose "Copy video URL at current time" to get e.g. https://youtu.be/xZGvCoG2G3Y?t=133 . This could then be modified as above, or you can just note the time in seconds. Obviously, you can do the same thing for the end time if desired.

For my obligatory example, I'll choose the legendary seamless saxophone switch by Dick Parry in David Gilmour's (of Pink Floyd fame) performance of Shine On You Crazy Diamond. A search in YouTube located the video, and I paused at the appropriate point, used the context menu, chose Copy Video URL at Current Time, and pasted the following URL into a spare tab: https://youtu.be/5uiVpxDuAhc?t=544 . Changing the main address to youtube.com, adding embed, and changing ?t= to ?start=, I end up with
https://youtube.com/embed/5uiVpxDuAhc?start=544 . Pasting that into a browser doesn't work, so I used the new embed button in the AEVA editor and pasted the URL between the start and end embed tags. I use Preview to test that this works (it does), and I do the pause and capture URL thing again to find the end time I want, 553. This results in
[embed]https://youtube.com/embed/5uiVpxDuAhc?start=544&end=553[/embed] , which gives the final result:



If you're a Pink Floyd fan, the whole video is worth watching; it's recorded in 1080p. Use the Watch on YouTube option at the bottom of the video.

[ Edit: numerous small improvements; thanks Weber. ]
[ Edit: Killed annoying live URLs with the "Do not automatically parse URLs" option. ]
[ Edit: can have end time without a start time. Sigh.]
Nissan Leaf 2012 with new battery May 2019.
5650 W solar, 2xPIP-4048MS inverters, 16 kWh battery.
1.4 kW solar with 1.2 kW Latronics inverter and FIT.
160 W solar, 2.5 kWh 24 V battery for lights.
Patching PIP-4048/5048 inverter-chargers.

AlvinKallicharran
Noobie
Posts: 2
Joined: Fri, 11 Oct 2019, 21:34
Real Name: Alvin Kallicharran

Re: New [embed]...[/embed] BBCode

Post by AlvinKallicharran » Sun, 13 Oct 2019, 23:49

very good option for us, specially as it allows us to add an optional start time and/or end time, in seconds. thanks for sharing

Post Reply