WordPress.org

Forums

Flash Player for Podcast Enclosures (6 posts)

  1. andymatic
    Member
    Posted 9 years ago #

    I'm trying to hack together a plugin that if a post has an enclosure that it will output a Flash audio player for that audio enclosure. I'm using http://musicplayer.sourceforge.net/ for the MP3 player. I grabbed the code out of feed-functions.php and have been tweaking it but am not able to get the plugin to return the post + the enclosure/player.

    function rss_enclosure_player() {
    global $id, $post;
    if (!empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password)) return;

    $custom_fields = get_post_custom();
    if( is_array( $custom_fields ) ) {
    while( list( $key, $val ) = each( $custom_fields ) ) {
    if( $key == 'enclosure' ) {
    if (is_array($val)) {
    foreach($val as $enc) {
    $enclosure = split( "n", $enc );
    $text = $the_content . trim( htmlspecialchars($enclosure[ 0 ]) );
    return $text;
    }
    }
    }
    }
    }
    }

    add_filter('the_content', 'rss_enclosure_player');

    For right now I'm just trying to get it to return the enclosure URL - then I'll focus on integrating the player. This code only outputs the enclosure URL - it doesn't append it to the post content.

    Thanks for your help!

  2. trike
    Member
    Posted 9 years ago #

    Hi, you may be interested in precast, its a swf that pulls the podcast rss. http://www.timmadden.com.au/podcast-logos.htm

    t

  3. raster
    Member
    Posted 9 years ago #

    You might also want to see the work I've been doing to get WP to output XSPF: http://rasterweb.net/raster/2005/06/15/wordpress-xspf-and-podcasting/

    Once it all works properly, you can just feed the XSPF Web Music Player the XSPF URL and it should work.

  4. andymatic
    Member
    Posted 9 years ago #

    Uploaded the work I did on this so far. Sloppy though. Feel free to play.

  5. dss
    Member
    Posted 9 years ago #

    I've been thinking about how to present, and enclose podcasts as well. Sadly, the only choice seems to be loading the mp3 and then linking to it (thus auto creating an enclosure.)

    What i'd like is an obscure link to the mp3, and a clear link to something like Owen's flash filter plus. This way, the lazy-pants can listen online without actually downloading anything, and subscribers can still aggregate the rss and get the file.

    The solution I've come up with is to use Flash Filter Plus to present the show as a "listen" link, and then in my meta tags where I put the little mp3 and rss images, create the link to the files there.

    Still not perfect.

  6. Boriel
    Member
    Posted 9 years ago #

    I've developed a WordPress Plugin to embed XSPF Player into it. Look at http://www.boriel.com/?page_id=12

    Perhaps it suits to you.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.