WordPress.org

Ready to get started?Download WordPress

Forums

wp embed register handler on 3.2.1, mistake? (5 posts)

  1. caneblu
    Member
    Posted 3 years ago #

    Just upgraded to 3.2.1 and my function for wp_embed_register_handler (ha worked fine since last year) as stopped to work. No errors.. but video not appear ad show only the url..
    is changed anything on 3.2.1? changelog did not help me.

  2. caneblu
    Member
    Posted 3 years ago #

    only me have this problem?

  3. Jon Breitenbucher
    Member
    Posted 3 years ago #

    I have a similar issue. I am adapting a working video embed plugin I wrote and have just changed function names and regex in the new plugin. I activate the new plugin and test the regex in a post and nothing happens. It's like the filter for this plugin isn't firing.

  4. caneblu
    Member
    Posted 3 years ago #

    Hi Jon, i resolved myself the problem. If i remember correctly the problem was on the function. I rewrite it from scratch, wipe the unused variables (the embed i write is for livestream.com). Hope this help you.

  5. Jon Breitenbucher
    Member
    Posted 2 years ago #

    It still isn't working for me and I'm wondering if it's because the service isn't looking for <object><embed></embed></object> syntax in what is being put in in place of the URL. Here is what I have

    wp_embed_register_handler( 'woostervideo', '#rtmp://adobeflash.wooster.edu/vod/(.+)#', 'wp_embed_handler_woostervideo');
    
    function wp_embed_handler_woostervideo( $matches, $attr, $url, $rawattr ) {
    	$width = get_option('woostervideoautoembed_player_width', '480');
    	$height = get_option('woostervideoautoembed_player_height', '360');
    
    	$embed = sprintf(
    			'<object id="flowplayer" width="' . esc_attr($width) . '" height="' . esc_attr($height) . '" data="http://webapps.wooster.edu/player/swf/flowplayer.swf" type="application/x-shockwave-flash"><param name="movie" value="http://webapps.wooster.edu/player/swf/flowplayer.swf" /><param name="allowfullscreen" value="true" /><param name="flashvars" value=\'config={"key":"#$28d4f4f3f205e518e4a","clip":{"provider":"rtmp","live":true,"url":"%1$s","autoBuffering":true,"autoPlay":false},"plugins":{"rtmp":{"url":"flowplayer.rtmp.swf","netConnectionUrl":"rtmp://adobeflash.wooster.edu/vod"}}}\' /></object>',
    			esc_attr($matches[1])
    			);
    
    	return apply_filters( 'embed_woostervideo', $embed, $matches, $attr, $url, $rawattr );
    }

    I check the regex with an online regex testing tool and it is matching exactly what I want. So I'm not sure what is wrong.

Topic Closed

This topic has been closed to new replies.

About this Topic