WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#29267 closed enhancement (fixed)

wp_video_shortcode should support vimeo

Reported by: maimairel Owned by: wonderboymusic
Milestone: 4.2 Priority: normal
Severity: normal Version: 3.9.2
Component: Media Keywords: has-patch
Focuses: Cc:

Description

The latest mediaelementjs (v2.5.1) supports vimeo videos, so wp_video_shortcode should be able to handle this. Currently wp_video_shortcode only looks for youtube videos by checking the URL through regex.

This is a must-add to 4.0!

Attachments (3)

29267.diff (1.2 KB) - added by Tmeister 7 years ago.
29267.2.diff (12.2 KB) - added by wonderboymusic 7 years ago.
29267.3.patch (2.0 KB) - added by dimadin 7 years ago.

Download all attachments as: .zip

Change History (16)

#1 @maimairel
7 years ago

Sorry, I meant v2.15.1 is the latest version of mejs :)

#2 @helen
7 years ago

It is too late for enhancements to 4.0. Perhaps 4.1 with a patch, though.

#3 @maimairel
7 years ago

Actually one line of regex matching should do the job :)

/wp-includes/media.php, line 1718

if ( ! preg_match( $yt_pattern, $src ) || ! preg_match( $vimeo_pattern, $src ) ) {

Well if not I can wait until 4.1.

Thank you!

Last edited 7 years ago by maimairel (previous) (diff)

@Tmeister
7 years ago

#4 @Tmeister
7 years ago

  • Keywords 2nd-opinion added

This is a partial patch, this patch add support to Vimeo video source in the video shortcode (wp_video_shortcode).

As you can see in the image attached the video is rendered but the video player has a black bar in the bottom ( video Controls ) http://screencast.com/t/wlML14FUY .

What is the best way to tackle this? Adding a class to the video tag? see https://core.trac.wordpress.org/browser/trunk/src/wp-includes/media.php#L1846 and add the proper css class in the css files to hide the bar?

#5 @wonderboymusic
7 years ago

  • Keywords has-patch needs-refresh added; 2nd-opinion removed
  • Milestone changed from Awaiting Review to Future Release

Vimeo in MEjs requires that Froogaloop is also loaded. When it is, it is breaking jQuery. I have an example patch: 29267.2.diff

#6 @wonderboymusic
7 years ago

  • Keywords needs-refresh removed
  • Milestone changed from Future Release to 4.2

#7 @wonderboymusic
7 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 31016:

Support chromeless Vimeo via MEjs:

  • Bump MediaElement script loader versions to 2.16.2 - missed in [30634], oops!
  • Add Froogaloop to js/mediaelement scripts for Vimeo
  • Check for Vimeo in the same locations that YouTube is checked
  • Dynamically load Froogaloop script in admin when editing a TinyMCE view
  • Edit MediaElement to call mejs.$.extend instead of $.extend in mejs.HtmlMediaElementShim.createPlugin(), since $ is not available via WP's jQuery (I will report this upstream):

https://github.com/johndyer/mediaelement/blob/6f9a78e008de2de796a1797077a74a94763320f9/src/js/me-shim.js#L631

Fixes #29267.

#9 @dimadin
7 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

You missed to add froogaloop.min.js. I got one from https://github.com/vimeo/player-api/blob/master/javascript/froogaloop.min.js (with first line removed) so I'm unsure if that is the same version.

@dimadin
7 years ago

#10 @wonderboymusic
7 years ago

Thanks @dimadin - that was an svn miss on my part, I'll add it soon

#11 @SergeyBiryukov
7 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

[31115] missed the ticket.

#12 @wonderboymusic
7 years ago

In 31487:

Restore the changes I made in [31016] for chromeless Vimeo that were missed in [31373].

Make sure that the build file for grid doesn't load views/media-details.js, it already exists in the audio-video build.

See #29267, #28510.

#13 @wonderboymusic
7 years ago

In 31625:

When editing/viewing the details of a [video] shortcode that has Vimeo as its source, and Froogaloop has not already been lazy-loaded, check the details of the state's model for the video src, instead of the HTML element.

See #29267.

Note: See TracTickets for help on using tickets.