WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. Jason Judge
    Member
    Posted 10 months 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.

    http://wordpress.org/plugins/media-element-html5-video-and-audio-player/

  2. Jason Judge
    Member
    Posted 10 months 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>
    		{$mp4_source}
    		{$mp3_source}
    		{$webm_source}
    		{$flv_source}
    		{$wmv_source}
    		{$ogg_source}
    		{$captions_source}
    		<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}" />
    		</object>
    	</{$tagName}>
    <script type="text/javascript">
    jQuery(document).ready(function($) {
    	$('#wp_mep_$mediaElementPlayerIndex').mediaelementplayer({
    		m:1
    		{$loop_option}
    		{$controls_option}
    		{$audio_size}
    	});
    });
    </script>
    
    _end_;

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

    @$mediahtml .= @<<<_end_
            ...
    _end_;

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

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.