WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Audio Player] HTML5 compatibility? (4 posts)

  1. pampfelimetten
    Member
    Posted 4 years ago #

    Hi there,

    I recently opened a new blog http://www.dancendancen.com/ and I use your fantastic plugin. But as I want to reach as many people as possible, it would be nice to have a html5 fallover for the iphone / future ipad visitors. Do you plan to implement that anytime soon?
    If not, is it possible to add a hook / filter at the right point, so I can code the thing myself?

    Thanks in advance,
    Thomas

  2. hearvox
    Member
    Posted 4 years ago #

    I edited the file: /plugins/audio-player/audio-player.php

    in the: function getPlayer
    got the variable: $playerCode
    i inserted: <audio src="' . $source . '" controls>Flash stuff...</audio>

    so, where the original read:
    $playerCode = '<p class="audioplayer_container"><span style="display:block;padding:5px;border:1px solid #dddddd;background:#f8f8f8" id="' . $playerElementID . '">' . sprintf(__('Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version <a href="%s" title="Download Adobe Flash Player">here</a>. You also need to have JavaScript enabled in your browser.', $this->textDomain), 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW') . '</span></p>';

    it now sez (i also shortened the Flash stuff):
    $playerCode = '<p class="audioplayer_container"><span style="display:block;padding:5px;border:1px solid #dddddd;background:#f8f8f8" id="' . $playerElementID . '"><em>' . sprintf(__('Play audio: <audio src="' . $source . '" controls><br />Audio player needs Flash9+ (<a href="%s" title="Download Adobe Flash Player">download</a>) and JavaScript.', $this->textDomain), 'http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW') . '</audio></em></span></p>';

    of course. this is a bonehead way to do it, b/c:

    1. i'll need to redo it after every upgrade of this plugin;
    2. i really should check first to see:
    a. does browser supports the html 5 audio tag? (IE8: no.)
    b. if so, will it play an mp3? (Firefox & Opera: no, Safari & Chrome: yes.)
    3. then i should script the html so:
    a. if yes to both, write only the html5 audio tag (w/ src), not the Flash stuff.
    b. if no to either, write only the Flash stuff, not the html5.

    more at:
    http://html5doctor.com/native-audio-in-the-browser/

    but this does get job done for iPhone, for now.

  3. pampfelimetten
    Member
    Posted 4 years ago #

    hearvox: thanks for the tip!

    I still hope to get feedback from the original plugin author, as this will get a more and more pressing issue, I think.

  4. choibc
    Member
    Posted 3 years ago #

    Is this modification reflected to new "audio player" plugin?

Topic Closed

This topic has been closed to new replies.

About this Topic