#24764 closed enhancement (fixed)
Support mediaelement.js YouTube sources in the video shortcode
Reported by: | jancbeck | Owned by: | wonderboymusic |
---|---|---|---|
Milestone: | 3.9 | Priority: | normal |
Severity: | normal | Version: | 3.6 |
Component: | Embeds | Keywords: | has-patch |
Focuses: | Cc: |
Description
mediaelement.js supports youtube videos as source urls (see: mediaelementjs.com/examples/?name=youtube) but currently that feature is unused in favor of an embedded iframe.
It appears to me that embed urls are passed to the video shortcode as source attribute so a possible fix would be to have the shortcode accept youtube urls like this: [video src="http://www.youtube.com/watch?v=oAiVsbXVP6k"]
Attachments (1)
Change History (15)
#2
@
11 years ago
- Milestone Awaiting Review deleted
- Resolution set to wontfix
- Status changed from new to closed
#3
follow-up:
↓ 5
@
11 years ago
Embedding doesn't always work like a charm when using the the visual editor. If you have some formatting turned on each line may be surrounded by a html element with style. This makes WordPress not see, or detect, the URL as on it's own line.
I the text editor it works like a charm. I always instruct my clients to paste the URL using the text editor, or use the shortcodes provided by Jetpack.
#4
@
11 years ago
- Summary changed from Use mediaelement.js for youtube embeds to Support mediaelement.js YouTube sources in the video shortcode
I think the ticket title was a bit misleading, actually - I don't think jancbeck was proposing that we ditch oEmbed for YouTube, just that our mediaelement.js implementation should support a YouTube URL as the source. I'll ask wonderboymusic to come take a look - I don't know what it does/doesn't do now.
#6
follow-up:
↓ 7
@
11 years ago
- Keywords needs-patch added
- Milestone set to 3.9
- Resolution wontfix deleted
- Status changed from closed to reopened
This is actually pretty easy to accomplish, all it requires is switching the mime to video/youtube
when src
equals a YouTube-y URL - ME.js supports this out of the box.
I will throw it onto the AV2.0 pile for now for investigation - sorry big bad ocean90 closed this
#7
in reply to:
↑ 6
@
11 years ago
Replying to wonderboymusic:
This is actually pretty easy to accomplish, all it requires is switching the mime to
video/youtube
whensrc
equals a YouTube-y URL - ME.js supports this out of the box.
This is exactly what I ment. Sorry for not being more clear about this.
#8
@
11 years ago
- Keywords has-patch added; needs-patch removed
24764.diff will play YouTube vids chromeless using ME.js - it's pretty cool. Supports the following patterns of YouTube URL as src
[video src="http://www.youtube.com/watch?v=oAiVsbXVP6k"] [video src="http://youtube.com/watch?v=oAiVsbXVP6k"] [video src="http://youtu.be/oAiVsbXVP6k"] [video src="https://www.youtube.com/watch?v=oAiVsbXVP6k"] [video src="https://youtube.com/watch?v=oAiVsbXVP6k"] [video src="https://youtu.be/oAiVsbXVP6k"]
#9
@
11 years ago
- Owner set to wonderboymusic
- Resolution set to fixed
- Status changed from reopened to closed
In 27063:
#10
@
11 years ago
- Resolution fixed deleted
- Status changed from closed to reopened
Presumably that is not supposed to be a double dollar sign on $fallback
on line 1228.
We should've had a unit test that would have exposed this due to the non-existent variable.
#11
@
11 years ago
Those are supposed to be interpolated like that, are you getting a non-existent var error? you shouldn't
#12
@
11 years ago
- Resolution set to fixed
- Status changed from reopened to closed
No errors because no testing -- I was just reading through commits. I saw $fallback
on line 1225 and just 3 lines later I saw $$fallback
so I assumed it was a mistake. I failed to notice that $$fallback
was in use elsewhere in the file.
Sorry for the false alarm! Oops. :(
#13
follow-up:
↓ 14
@
11 years ago
Hi @wonderboymusic. Would it be possible to enhance a bit this fix to make it possible to add other video providers ? You could introduce an array similar to this one :
$video_provider = array( 'video/youtube' => '#^https?://(:?www\.)?(:?youtube\.com/watch|youtu\.be/)#' );
and pass it to a filter so that plugin developers can add new providers. Then, they would just need to use a js video player that support those providers. For example, I [forked mediaelement.js](https://github.com/johndyer/mediaelement/pull/663) to make it support Dailymotion videos in the same way it supports YouTube ones.
That sounds like plugin material. WP Embed works like a charm, there is no need for another shortcode to just display the video in another way.