• I know since WP 3.6 we’ve been able to upload and embed various file formats and that the Add Media button effectively implements the correct media embed shortcode for us.

    I’m having a problem in WP4.0 using ‘Add Media’ to embed quicktime (.mov) files. The embed works fine for the other supported video MIME types but I’m not offered ‘Embed Media Player’ when I try adding a .mov file to a post.

    See screen grabs/explanation here

    Does anyone have any suggestions as to why this is, or to a possible fix so I can embed .mov as easily as .mp4 – seems to be the preferred format of the client. For the moment we’re having to manually add the [video] shortcode ourselves in the text editor.

    Before you suggest, using YouTube/Vimeo, I am going to propose this as an alternative, but it is a much more involved process for a busy teacher client.

Viewing 7 replies - 1 through 7 (of 7 total)
  • I’m having the same issue, and am hunting for a solution. I’ll let you know what I find, if anything.

    I just found this… and it seems to be working for me. You just need to add the code to your functions.php file.

    /**
     * Add support for the QuickTime (.mov) video format.
     */
    add_filter( 'wp_video_extensions',
        function( $exts ) {
            $exts[] = 'mov';
            return $exts;
        }
    );

    https://wordpress.stackexchange.com/questions/165706/embed-mov-file-via-add-media-not-working

    Thread Starter dozza

    (@dozza)

    How funny. That was my duplicate posting on stack exchange.

    Bizarrely, that seems to break my site when added to child theme functions.php

    Is it formatted correctly?

    You can wrap the link to the video in short codes and it will work without the filter.

    Example

    [video width="2000" height="720" mov="https://example.com/wp-content/uploads/2015/05/demo.mov"][/video]

    Hi, I just stumbled in here ??

    If we want to upload the .mov file, we will need the above filter, because it’s not supported by default.

    If we already have the .mov file uploaded to our site (like via ftp), we can use the shortcode directly, just as Brad Dalton mentioned.

    @dozza – note that I wrote the above filter example with PHP 5.3+ in mind, so most likely you got an older PHP version. If that’s the case, then this should work:

    /**
     * Add support for the QuickTime (.mov) video format (PHP < 5.3 )
     */
    add_filter( 'wp_video_extensions', 'wpse_support_mov_format' );
    
    function wpse_support_mov_format( $exts ) {
        $exts[] = 'mov';
        return $exts;
    }

    If we want to upload the .mov file, we will need the above filter, because it’s not supported by default.

    Some references on allowed mime types.

    About Uploading Files on Dashboard >> WordPress supports uploading the following file types: See video

    https://core.trac.www.ads-software.com/browser/branches/4.2/src/wp-includes/functions.php#L2164

    // Video formats.
    2185	        'asf|asx' => 'video/x-ms-asf',
    2186	        'wmv' => 'video/x-ms-wmv',
    2187	        'wmx' => 'video/x-ms-wmx',
    2188	        'wm' => 'video/x-ms-wm',
    2189	        'avi' => 'video/avi',
    2190	        'divx' => 'video/divx',
    2191	        'flv' => 'video/x-flv',
    2192	        'mov|qt' => 'video/quicktime',
    2193	        'mpeg|mpg|mpe' => 'video/mpeg',
    2194	        'mp4|m4v' => 'video/mp4',
    2195	        'ogv' => 'video/ogg',
    2196	        'webm' => 'video/webm',
    2197	        'mkv' => 'video/x-matroska',
    2198	        '3gp|3gpp' => 'video/3gpp', // Can also be audio
    2199	        '3g2|3gp2' => 'video/3gpp2', // Can also be audio

    hehe, many thanks for the correction @claytonjames, the uploading is indeed supported and been for a long time ??

    I was just too hasty here recalling the problem – the question wasn’t about uploading problems, but regarding the embedding via the “Add Media”.

    By default the wp_get_video_extensions() returns

    'mp4', 'm4v', 'webm', 'ogv', 'wmv', 'flv'

    where we can add 'mov' via the wp_video_extensions filter.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Embed .mov file via 'Add Media' not working’ is closed to new replies.