MediaElement.js - HTML5 Video & Audio Player
Not working on PHP 5.4 (2 posts)

  1. Jason Judge
    Posted 2 years ago #

    We were working fine on PHP 5.3, but get bunches of errors on PHP 5.4 (mainly undefined variables).

    Notice: Undefined variable: type_attribute in /var/www/vhosts/example.com/httpdocs/wp-content/plugins/media-element-html5-video-and-audio-player/mediaelement-js-wp.php on line 428

    This gores up to line 453, with dozens more undefined variables.


  2. Jason Judge
    Posted 2 years ago #

    It is this bit of code, and most of the variables are not set:

    $mediahtml .= <<<_end_
    	<{$tagName} id="wp_mep_{$mediaElementPlayerIndex}" {$src_attribute} {$type_attribute} {$width_attribute} {$height_attribute} {$poster_attribute} controls="controls" {$preload_attribute} {$autoplay_attribute} $video_skin_attribute>
    		<object width="{$width}" height="{$height}" type="application/x-shockwave-flash" data="{$dir}flashmediaelement.swf">
    			<param name="movie" value="{$dir}flashmediaelement.swf" />
    			<param name="flashvars" value="controls=true&file={$flash_src}" />
    <script type="text/javascript">
    jQuery(document).ready(function($) {

    Until there is an update, I'm suppressing the errors with a horrible, horrible hack:

    @$mediahtml .= @<<<_end_

    Note it requires TWO @s as both sides of the assignment have missing variables ($mediahtml does not exist, but is being appended to).

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • MediaElement.js - HTML5 Video & Audio Player
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.