Closed (cannot reproduce)
Project:
MediaElement
Version:
7.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
7 Apr 2011 at 14:02 UTC
Updated:
24 Oct 2019 at 22:53 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mfer commentedNot easily. This module is designed to take a file or url for a h.264 video and play it. If you can get that URL or upload the file you can play it. With YouTube this is not so easy.
Comment #2
shawn_smiley commentedRelated to this question, is there a way to configure MediaElement or the Media module so that it will use the default YouTube display with YouTube Videos and use Media Element for local videos?
So far I've been able to get a site to either display YouTube videos and local videos get a download link or display local videos using MediaElement and YouTube videos get a download link within the MediaElement player.
Comment #4
mpotter commentedI am re-opening this as a feature request. I have a mix of video sources (via the Media module). Some are local and need the MediaElement player (such as MP3, WMV, etc). However, some are external links to YouTube. This is all via a Media field within a content type.
If I set the display of this field to be MediaElement, then YouTube videos do not show the normal embedded YouTube player. They simply show the "Download File" link. But the local files work fine.
If I set the display of this field to be Generic File then the YouTube video shows correctly with the embedded player, but of course now none of the other local files show any player.
There definitely needs to be a way to tell MediaElement to ignore a field that uses an external URI (such as YouTube) so that it does not overwrite the embedded player.
Comment #5
mpotter commentedI have a temporary "fix" for this. I'm not going to make it a real patch because this is very specific to fixing MediaElement to work with Media:YouTube and I'm sure there is a *much* better way to generalize this code.
In the mediaelement.module file, find the function "mediaelement_field_formatter_view". What we want to do is prevent the mediaelement field display from activating for youtube items. Existing code:
Add code just after the "foreach" so it looks like this:
Perhaps somebody else can improve this to handle any scheme that isn't "public" to properly fill in the correct theme function. I just hard-coded this specific case for the Media:YouTube module so that I could get my client site working. But I hope this helps somebody else dealing with this and inspires the MediaElement module developers to do a more general fix.
Comment #6
pbuyle commentedWith recent version of Media, this shouldn't require change to the MediaElement module. For your file type, you can select different file formatters and sort them. The first one to return a result will then be used. If you have, or made, a Youtube formatter that only return a render element if the media (actually a File entity) is a YouTube video, give it a lighter weight and it will be used prior to MediaElement.
Comment #7
rob c commentedI think it has more to do with the player rendered (to match on the whole site). So all video's look and feel the same. (feature: player templates/themes, anyone?)
@mongolito404 nice info, but would that do what i describe? Else we'lll need to theme the youtube player with some mediaelement saus to get where i want to go for example. Or am i missing something completely?
(and shouldnt youtube be on top just like flickr vimeo etc by default? mediaelement will never have to deal with all these anyway, so why put mediaelement higher on that page you describe?) (just a thought)
Comment #8
BeaPower commentedAny updates?
Comment #9
citlacom commentedI did a similar patch to support media_vimeo and media_youtube due the conflict that happens when are installed with mediaelement. The solution was similar as #5:
But this is not a clean fix and probably the hook_field_formatter_view() should be changed to hook_file_formatter_FORMATTER_view() as implemented in media_vimeo.formatters.inc of the media_vimeo module.
Comment #10
Letharion commentedI have need for the same thing. Attaching #9 as a patch instead so it can be used with drush make.
Comment #11
Letharion commentedNew patch for mediaelement 1.1
Comment #12
rwilson0429 commentedThanks for the patch. Tried to use the patch in #11. 'Hunk #1 Failed at 103.' Then, I tried #10, 'Hunk #1 failed at 128'.
Comment #13
alan d. commentedThis is a re-roll against 1.x branch
This is mostly Letharion work. Minor changes:
* The autoplay is not a setting from the formatter, but I've keep this in the properties loop with a isset() check to prevent warnings.
* Moved the $settings outside of the loop.
Related: html5 video wrappers for these fields
http://johndyer.name/html5-video-wrapper-for-youtube-and-vimeo-api-media...
Unrelated: This kinda feels functionally wrong. Shouldn't the media file define the base formatter and then call the specific media rendering handlers?
Comment #14
dpfitzsi commentedThanks Alan D., I know this is an old issue but I found I needed to resolve this use case today. Your patch works great against the -dev branch of the module.
Can this be committed?
Comment #15
martin.l commentedI used this patch and it worked for me:
https://drupal.org/node/1802388
Comment #16
jnettikTesting the current functionality of the plugin and module, YouTube links seem to play fine. Closing.