[Plugin: Degradable HTML5 audio and video] Default code is not working (5 posts)

  1. SauloB
    Posted 6 years ago #

    The default code is not working for me:


    All my links are in this format.

    But all my mp3 files are on another server, I trying add the 'format' tag but does not work.

    How can I fix it?



  2. soukie
    Posted 6 years ago #

    The shortcode format to use is a bit different. Check the documentation at http://soukie.net/degradable-html5-audio-and-video-plugin/

    In your case, it should be [audio src="http://myserver.com/mysong" format="mp3"].

  3. alanft
    Posted 6 years ago #

    a lot of people use the WP audio player plugin (as we do) with its old-fashioned (pre-shortcode) syntax, so it would help people to switch to this plugin if there was a 'compatibility mode'

    I'm hoping the blog authors will let me switch to your plugin, but to do that would take a bit of magic to go back and update all our audio embed codes. there's a couple of global search and replace plugins i know could do this, but until everyone is happy with the switch, I don't want to make those changes.

    so instead I've added this extra code after your "extract( shortcode_atts ..." line (at about line 56)

    # get audio player attributes
    	if ($src=="" && $atts[0]!="")
    	{	$src=trim($atts[0],": \t");
    		$src=$src[0];				# just parse out the src for now. other params like Titles= could be used in a later version

    (I have another plugin that makes your autodetect fail, so added a $format="mp3" in there too)

    hope this helps

  4. soukie
    Posted 6 years ago #

    That looks like a very good workaround! Mind if I use that in the next version, together with adding the default "mp3" (I think we can safely assume that any 'legacy' shortcodes in the [audio:your_mp3_file.mp3] syntax mp3 (well, I can actually sniff the extension because it is included there).

  5. alanft
    Posted 6 years ago #

    please do!

Topic Closed

This topic has been closed to new replies.

About this Topic