Embedded video in forums and streams
-
I’ve an issue which seems to have many threads going in various directions, and many debates over security etc. but not a lot of resolution (and a lotLotLOT of replies offering fixes which seem to have no effect).
The people I’m developing a site for right now desperately want to embed videos in activity streams and forum threads, but they are doing so from their own bespoke video in the form of:
<object width="629" height="354" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" id="example"> <param name="movie" value="http://example.com/example.swf" /> <param name="allowfullscreen" value="true" /> <param name="allowscriptaccess" value="always" /> <param name="flashvars" value="seed_name=imama-tv&presentation_id=6" /> <param name="name" value="example" /> <param name="wmode" value="transparent" /> <embed src="http://example.com/example.swf" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" flashvars="example" width="629" height="354" name="example" wmode="transparent" /> </object>
This is immediately stripped out, and none of the unfiltered plugins or other edits seem to have any effect on this. I absolutely must find a way to embed these videos or the whole project will fail – what would be best practice to do so?
Sorry to create a new thread, but I’m hoping to get a clearer answer than some of the speculation in the other similar ones.
-
you’ll need to add allowedtags to the filters
bp_activity_allowed_tags
andbp_forums_allowed_tags
You should try the oEmbed plugin! It automatically allows you to insert videos from youtube/vimeo and others by simply putting in the URL.
https://wordpress.org/extend/plugins/oembed-for-buddypress/
Thanks Rich – that’s more like the guidance I was after! The other threads could have done with that kind of concise information.
Bowe – as I said, not using Vimeo or YouTube and have tried all the unfiltering plugins, but it seems like I have an answer to try now anyway – thanks!
+1 on this thread… I wasn’t aware of those allowed_tags functions. Thank you!
That said, I added this to my bp-activity-filters.php and bp-forums-filters.php files to test, and still have nothing:
$activity_allowedtags['object'] = array();
$activity_allowedtags['param'] = array();
$activity_allowedtags['embed'] = array();
(All was added between:
function bp_forums_filter_kses( $content ) {
global $allowedtags;
$forums_allowedtags = $allowedtags;
… and:
$forums_allowedtags = apply_filters( 'bp_forums_allowed_tags', $forums_allowedtags );
return wp_kses( $content, $forums_allowedtags );
}
… with all the other tags of course.
You have to add the tag attributes as well. For YouTube, you’ll have to add these to the bp-forums-filters file:
$forums_allowedtags[‘object’] = array();
$forums_allowedtags[‘object’][‘width’] = array();
$forums_allowedtags[‘object’][‘height’] = array();
$forums_allowedtags[’embed’] = array();
$forums_allowedtags[’embed’][‘src’] = array();
That works for me.
Will this fix the problem with blogs as well? Or just the activity streams?
- The topic ‘Embedded video in forums and streams’ is closed to new replies.