Skip to:
Content
Pages
Categories
Search
Top
Bottom

Embedded video in forums and streams

  • Avatar of chris-billett
    Chris Billett
    Participant

    @chris-billett-2

    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.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Avatar of rich! @ etiviti
    rich! @ etiviti
    Participant

    @nuprn1

    you’ll need to add allowedtags to the filters bp_activity_allowed_tags and bp_forums_allowed_tags

    Avatar of Bowe
    Bowe
    Participant

    @bowromir

    You should try the oEmbed plugin! It automatically allows you to insert videos from youtube/vimeo and others by simply putting in the URL.

    http://wordpress.org/extend/plugins/oembed-for-buddypress/

    :)

    Avatar of chris-billett
    Chris Billett
    Participant

    @chris-billett-2

    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!

    Avatar of 3sixty
    3sixty
    Participant

    @3sixty

    +1 on this thread… I wasn’t aware of those allowed_tags functions. Thank you!

    Avatar of chris-billett
    Chris Billett
    Participant

    @chris-billett-2

    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.

    Avatar of 3sixty
    3sixty
    Participant

    @3sixty

    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.

    Avatar of alanchrishughes
    alanchrishughes
    Participant

    @alanchrishughes

    Will this fix the problem with blogs as well? Or just the activity streams?

Viewing 7 replies - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.