WordPress.org

Support

Support » Plugins and Hacks » JW Player for Flash & HTML5 Video » [Resolved] [Plugin: JW Player Plugin for WordPress] JW Player breaks WordPress Media Editor

[Resolved] [Plugin: JW Player Plugin for WordPress] JW Player breaks WordPress Media Editor

  • With the JW Player plugin activated the Media Editor will not save edited images, you get a Javascript Syntax error “Unable to parse JSON string”.

    To reproduce, edit any image in the Media Library and crop, rotate or flip the image then click the “Save” button; you’ll see the spinner, but nothing will happen. If you debug the JavaScript you’ll see the syntax error. If you deactivate the plugin and try the same steps, it works fine.

    To fix it I edited media/JWMediaFunctions.php and modified the url_attached_file function to check the mime type of the media file and only act on video files.

    Here is the updated function:

    function url_attached_file($file, $attachment_id) {
    	if (substr($post["post_mime_type"], 0, 5) == "video") {
    		$upload_dir = wp_upload_dir();
    		return str_replace($upload_dir["basedir"] . "/", "", $file);
    	} else {
    		return $file;
    	}
    }

    http://wordpress.org/extend/plugins/jw-player-plugin-for-wordpress/

Viewing 1 replies (of 1 total)
  • Plugin Author JW Player

    @longtail-video

    Hi gwrey,

    Thanks for catching that bug. I’m currently working on an update right now and will be sure to include that fix.

    Thanks.

Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] [Plugin: JW Player Plugin for WordPress] JW Player breaks WordPress Media Editor’ is closed to new replies.
Skip to toolbar