embed video?

166 views
Skip to first unread message

Stephen S

unread,
Dec 1, 2010, 7:54:30 AM12/1/10
to Magic Fields
Does anyone know if it is possible to upload and embed a video into a
field in a magic fields panel? I have tried the "Image (Upload Media)"
type without success. Ideally one could upload a video to a field with
some presets (such as width, height, show controls or not), but I
can't find anyway to accomplish this.

Traversal

unread,
Dec 1, 2010, 5:46:18 PM12/1/10
to Magic Fields
Hey, there's not really any "video" field type in MF, but you can get
pretty close by using a Multiline text, and then taking advantage of
Wordpress AutoEmbeds: http://codex.wordpress.org/Embeds. You can then
embed, say a youtube clip by simply putting something like this in the
content:

[embed width="640" height="480"]http://www.youtube.com/watch?
v=VIDEOID[/embed]

If you need your own movie file, try installing
http://wordpress.org/extend/plugins/vipers-video-quicktags/ which
allows some other file types too.

Eventually, we'll make some proper "Video" field types, but the
priority right now is Custom Post Type support :)

Good luck!

Hunk

unread,
Dec 1, 2010, 6:27:07 PM12/1/10
to Magic Fields

Daniel DD

unread,
May 11, 2013, 8:21:34 AM5/11/13
to magic-...@googlegroups.com
Better way or at least work for me, using markdown text field and pasting directly there the insert script from youtube:

<iframe width="560" height="315" src="http://www.youtube.com/embed/EKA1CXBOchY" frameborder="0" allowfullscreen></iframe>

Mikael Wehner

unread,
May 11, 2013, 8:53:34 AM5/11/13
to magic-...@googlegroups.com
A better way of showing Youtube/Vimeo videos would be to use the built in oEmbed technology. Make a text field in Magic Fields that contains your Youtube or Vimeo URL and then use this method:

<?php echo wp_oembed_get( get_post_meta($post->ID, "videourlcustom", true) ); ?>

This example is taken from how to use oembed with a custom field so you should be able to replace the $post->ID, "videourlcustom"  with whatever method you are using to pull your video URL from Magic Fields.
oEmbed builds the player for you using custom fields. I'm pretty sure you can pass variables on the URL in order to show/hide controls etc, but that's for you to figure out yourself.

Regards,
Mikael




Daniel DD wrote:
--
 
---
You received this message because you are subscribed to the Google Groups "Magic Fields" group.
To unsubscribe from this group and stop receiving emails from it, send an email to magic-fields...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


box-logo Mikael Wehner
Art Director, Graphic Designer & Visual Artist
+46 (0)708 449486 | Visit my projects at mikaelwehner.com
Reply all
Reply to author
Forward
0 new messages