Multisites, upload issues, and iOS!

This question has changed significantly.

I have the latest version of WordPress and am hosting it on an Apache server.
Link to Blog: http://blogs.bzaeds.org/test/2012/05/11/video-test/

Read More

Now, here’s the thing.

When I upload a video to WordPress it will play on a Mac in Firefox with the WordPress URL the item is given (ex: http://blogs.bzaeds.org/test/files/2012/05/720-dunk.mp4” provider=”video). In fact, I can go to that link right now on my Firefox browser and have no problems, it plays fine.

However, if I upload a video to WordPress and use the WordPress URL (ex: http://blogs.bzaeds.org/test/files/2012/05/720-dunk.mp4” provider=”video) it will not play on an iPad or iPhone.

Where this gets fun is — if I use the APACHE location for the file (ex: http://blogs.bzaeds.org/wp-content/blogs.dir/5/files/2012/05/bunny.mp4) it will play just fine on the Mac AND the iPad & iPhone.

I have been working on this issue for 4 days and I’m exhausted. I’ve finally narrowed it down to this, but I’m not sure what config setting would be causing an issue like this. Any help would be greatly appreciated!

Edit: It is looking like it’s the fact that WordPress can’t do byte handling and join this with Multi-site and different directories and you get chaos. I realize this is the issue, but I’m not sure what I’d do to workaround this issue and installing mod_xsendfile didn’t seem to work nor editing the jwplayer code (which I’ll try again, perhaps I did it wrong.)

Related posts

Leave a Reply

3 comments

  1. After 6 days of pure sadness, this ended up being the fix: http://www.technowut.com/2012/05/14/how-to-stream-videos-to-ios-devices-with-multisite-wordpress/

    Here’s how to get it working on CentOS 6 with the packaged Apache httpd:

    Nils Maier wrote the module for Apache httpd. Download the source and take some time to review the docs there.

    Compile and install the module on the command line:
    /usr/sbin/apxs -cia mod_xsendfile.c

    NOTE: I just used yum. 🙂

    yum install mod_xsendfile
    

    If you don’t have apxs, you probably need to install the httpd-devel package.

    Get that with this command:

     yum install httpd-devel
    

    Once compiled and installed, you’ll need to enable it in your httpd.conf or .htaccess (I enabled it by putting a file in my conf.d directory). These are the directives you’ll need to set:
    *(Note, I put this in my /etc/httpd/conf.d/wordpress.conf file instead of the httpd.conf.)

     XSendFile on
        XSendFileAllowAbove on
    

    Now restart Apache httpd

     /sbin/service httpd restart
    

    Finally, you’ll need to enable the support in your wp-config.php:
    define(‘WPMU_SENDFILE’, true);

  2. This is most likely a server configuration issue, so my answer may or may not help.

    I ran both requests through Fiddler shows slightly different headers for the different URLs: The Apache URL includes an Accept-Ranges: bytes header and the WP URL includes an Expires header for caching.

    WordPress URL Headers:

    HTTP/1.1 200 OK
    Date: Thu, 10 May 2012 21:13:01 GMT
    Server: Apache/2.2.15 (CentOS)
    X-Powered-By: PHP/5.3.3
    Content-Length: 2911708
    Last-Modified: Thu, 10 May 2012 19:32:05 GMT
    ETag: "bd22bdcf21b610bcbcf0a38e3e3b40ff"
    Expires: Sun, 12 Jul 2015 06:59:41 GMT
    Connection: close
    Content-Type: video/mp4
    

    **Apache URL Headers:

    HTTP/1.1 200 OK
    Date: Thu, 10 May 2012 21:13:24 GMT
    Server: Apache/2.2.15 (CentOS)
    Last-Modified: Thu, 10 May 2012 19:32:05 GMT
    ETag: "3ffee-2c6ddc-4bfb3acc88ad9"
    Accept-Ranges: bytes
    Content-Length: 2911708
    Connection: close
    Content-Type: video/mp4
    

    The data returned in the body of each request is identical. The only difference is the presence/lack of those headers (and the X-Powered-By header in the WP request). If the headers aren’t really the issue here, then I’d venture a guess that it has something to do with the device you’re testing on (broken content in the cache perhaps?).

    But both requests return the same content with the same encoding and the same content type … they should both be handled by any retrieving device the same way. Anything broken at that point isn’t WordPress.

  3. There’s a two years old thread in JW Player forum that deals with the issue and has a workaround that may work for you, but it involves hacking the plugin code.

    Longtail folks are very supportive and I suggest you open a ticket over there too. And maybe, I’m not sure, your question may be considered off-topic or too localized here.