Although it is possible to embed YouTube videos, this does not work with YouTube playlists. I'm not sure why this is so. It'd be nice if:
- I could embed playlists
- the preview playlist was just resized (as with videos) OR the preview from the first video in the playlist is used
- the thumbnail image was the thumbnail image from the first video in the playlist (I don't think playlists have their own thumbnail specified)
Here's some example (bogus) embed code:
Videos:
<object width="425" height="350"><param name="movie" value="http://www.youtube.com/v/videoid"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/videoid" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"></embed></object>
Playlists:
<object width="530" height="370"><param name="movie" value="http://www.youtube.com/p/playlistid"></param><embed src="http://www.youtube.com/p/playlistid" type="application/x-shockwave-flash" width="530" height="370"></embed></object>
You can distinguish playlists and videos by their url: playlists start with http://www.youtube.com/p/
, whereas videos start with http://www.youtube.com/v/
. This might be helpful if a distinction between videos and playlists needs to be made. Also, playlists always have an extra column listing the videos contained in it. This leads to different widths as with videos, so probably there'd have to be a setting that allows specifying height/width for videos and playlists seperately.
Comment | File | Size | Author |
---|---|---|---|
#18 | playlist.patch | 5.17 KB | Jody Lynn |
Comments
Comment #1
aaron CreditAttribution: aaron commentedthanks for the ideas; i'll see if i can work something like that into it. by next week, i should have another solution in place as well, to import specific videos from playlists (as an add-on module).
thanks,
aaron
Comment #2
Sara Adams CreditAttribution: Sara Adams commentedMy current solution is:
Include the embed-code in the body field, and add an image (hidden) that is only displayed where teasers are needed. It gives a similar result to what I need.
It'd still be nice if the Embedded Media Field would support both.
Supporting playlists should be easy:
Right now there's a regex used that needs a v (single video) to be in the link. If that check fails (empty), then check for p instead (playlist). Depending on which was successful (if any) you then use the according embed code.
I'm not sure about supporting thumbnails for playlist.
Comment #3
aaron CreditAttribution: aaron commentedplaylists is a couple of hours away (as soon as i can find that precious time to finish it up). already works for flickr -- embedded media import.
Comment #4
aaron CreditAttribution: aaron commentedpostponed to d6 release, then backport to d5.
Comment #5
Alex UA CreditAttribution: Alex UA commentedI'm marking this as fixed because this is now possible using the combination of emfield, FeedAPI, and the FeedAPI_Mapper. I will update this issue queue in the near future with a link to the handbook page after I create it.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.
Comment #7
rcross CreditAttribution: rcross commentedping. This was marked closed, but I can't seem to find the documentation being referred to. Pointers?
Comment #8
rcross CreditAttribution: rcross commentedmarking this as active again until it is resolved further
Comment #9
imclean CreditAttribution: imclean commentedA quick search turns this up: http://drupal.org/node/527320
Which links to this: http://www.drupaltherapy.com/feedapi
It's for Drupal 5 but the concept and most of the modules are the same.
Comment #10
marcvangendI think it shouldn't be too hard to get this working properly. Youtube playlists have their own url, formatted like http://www.youtube.com/view_play_list?p=[playlistID]. Nowadays the embed code provided by Youtube looks like this:
I have never written an emfield provider include, but if time permits, I would like to give it a go soon (for the 6.x version). I'm just wondering: what would be the best/proper/easiest way, enhance youtube.inc or create a new youtube_playlist.inc?
Comment #11
Alex UA CreditAttribution: Alex UA commentedThis has long been possible using FeedAPI, and will be available shortly via Feeds, so I'm marking this as "fixed"
Comment #12
rcross CreditAttribution: rcross commented@alexUA - can you provide a pointer to some documentation that suggests how that would integrate with this module?
Comment #13
adub CreditAttribution: adub commentedThere's a use case for doing this with the inline filter which wouldn't be doable with feeds creating nodes. Is that a separate feature request?
Comment #14
Alex UA CreditAttribution: Alex UA commented@adub, yes, that's a separate request. @rcross- it's linked to on both the main emfield page and in the Drupal documentation page that's linked on the front as well.
Comment #15
Alex UA CreditAttribution: Alex UA commentedActually, I'm reopening this, because what's being asked for is not the ability to add each video in a playlist, but rather the ability to embed the playlist itself, rather than a video.
Comment #16
Alex UA CreditAttribution: Alex UA commentedI'm investigating this for a client and here's what I think we need to do to get this to work with the current YouTube provider. We need to either use regex, as the provider is currently doing, or possibly switch it over to use parse_url(), and determine whether we're being passed a video or a playlist. We can grab the id as normal, but we'll have to save the information to use later so that we can output the correct player. After that, the only difference I can find is that we'll need to use '/p/' rather than '/v/' in the output url, so this should all be relatively straight forward and should definitely be added to the youtube provider file directly.
Comment #17
rcross CreditAttribution: rcross commented@Alex - yes, embedding the playlist is what I had been looking for. I would personally be ok with having a different field type, so that you don't have to do a lot of crazy detection in order to make it an all encompassing field. This could also be helpful at a theme level, to distinguish if it is a single video or playlist in the display.
Comment #18
Jody LynnHere's a patch to allow playlists. Getting the thumbnail from the first video in the playlist was a little complicated, but it's working for me.
Comment #19
Alex UA CreditAttribution: Alex UA commentedI added this to the 6.1x-dev branch- I'm marking "to be ported" so that it finds its way over to media_youtube at some point.
Comment #20
aaron CreditAttribution: aaron commentedcan you commit it to the 6.2x-dev as well? i haven't moved youtube out of there yet...
thanks!
Comment #21
aaron CreditAttribution: aaron commentedoops, changed status...
Comment #22
Alex UA CreditAttribution: Alex UA commentedDone- I'll leave the status until we move it over to media_youtube.
Comment #23
andtokyo CreditAttribution: andtokyo commented#18 Confirmed working...
Thanks Jody.
Comment #24
Alex UA CreditAttribution: Alex UA commentedI'm moving this to the Media: YouTube queue to make sure it gets committed there...
Comment #25
aaron CreditAttribution: aaron commentedok, I refactored and applied this patch. Thanks, @Jody Lynn!
Comment #27
jjclint CreditAttribution: jjclint commentedWhat about D7 I'm having no luck at all embedding playlist url's such as the following on the latest 7.x dev:
http://www.youtube.com/view_play_list?p=8DC5B92632D5898E
OR
http://www.youtube.com/p/8DC5B92632D5898E
Comment #28
jjclint CreditAttribution: jjclint commentedno one...?
Comment #29
foripepe CreditAttribution: foripepe commentedSame problem. Is there a way to insert Youtube playlists and/or channels to our sites under Drupal 7?
Comment #30
jjclint CreditAttribution: jjclint commented#foripepe I'm stuck at this for some time now, so far my best option was to use the oembed module, instead of media: youtube (http://drupal.org/project/oembed)
With oembed you can configure the url schemes from the configuration menu for quite a number of providers, so you won't get the can't handle url scheme error message.
At the moment I'm still struggling a bit with it, so let us know if you've managed to get it to work properly.
Comment #31
TravisCarden CreditAttribution: TravisCarden commentedSee #1651190: Playlist embeds still broken.