• Steven Xu

    (@stevenxu)


    WordPress version: 4.0
    Mainsite: teachers.domain.com
    Subsite: teachers.domain.com/username

    Mainsite upload file path: /wp-content/uploads/year/month/video.m4v
    Subsite upload file path: /wp-content/blogs.dir/blogid/files/year/month/video.m4v

    video site for testing:
    user1 blog id = 100
    site: teachers.domain.com/user1/sample-page
    embed video: video.m4v
    video URL : https://teachers.domain.com/user1/files/2014/11/video.m4v
    text code:
    [video width="768" height="768" mp4="https://teachers.domain.com/user1/files/2014/11/video.m4v"][/video]

    the video on test subsite works on computers,but not on iPad,when I click play button on iPad, it keep loading with black background, seems like it cannot find the video.

    If I change the mp4 url to “https://teachers.domain.com/wp-content/blogs.dir/100/files/2014/11/video.m4v” . IT WORKS on iPad.

    can anybody tell me why? “/wp-content/blogs.dir/100” should be the same as “user1” in media URL.

Viewing 15 replies - 1 through 15 (of 18 total)
  • User78342324

    (@rune-vantage)

    It sounds like an incorrectly configured .htaccess file.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Translation from Marc, what is the content of your .htaccess file? ??

    Thread Starter Steven Xu

    (@stevenxu)

    here is my .htaccess file:

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?$blogname/files/(.+) wp-content/blogs.dir/$blog_id/files/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?stevenxu2/files/(.+) wp-content/blogs.dir/176/files/$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # END WordPress

    If I upload a file to media library, the file goes to /wp-content/blogs.dir/100/files/20.4/11/file

    Thread Starter Steven Xu

    (@stevenxu)

    update: .htaccess file as following

    # BEGIN WordPress
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    
    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
    
    # add a trailing slash to /wp-admin
    RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
    
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
    RewriteRule . index.php [L]
    
    # END WordPress
    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    If I upload a file to media library, the file goes to /wp-content/blogs.dir/100/files/20.4/11/file

    You mean /wp-content/blogs.dir/100/files/2014/11/filename

    Right? That’s normal and where it should load.

    Did you delete these lines?

    RewriteRule ^([_0-9a-zA-Z-]+/)?$blogname/files/(.+) wp-content/blogs.dir/$blog_id/files/$2 [L]
    RewriteRule ^([_0-9a-zA-Z-]+/)?stevenxu2/files/(.+) wp-content/blogs.dir/176/files/$2 [L]

    If you were having to hard code those in, it may mean your site can’t handle the compelx htaccess rules.

    Thread Starter Steven Xu

    (@stevenxu)

    @ipstenu (Mika Epstein)

    yes, I mean /wp-content/blogs.dir/100/files/2014/11/filename.
    and I deleted that two test RewritRules.
    any idea why it cannot redirect to the right file location?

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Funny thing…

    https://teachers.domain.com/user1/files/2014/11/video.m4v” isn’t wrong.

    # uploaded files
    RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]

    That line in your .htaccess is supposed to tell the browser that the URLs with /files/ really go somewhere else. When that doesn’t work, it’s usually because your server doesn’t understand the complex .htaccess rules.

    Can you check if your httpd.conf file has AllowOverride set to “All” or “Options All”

    Thread Starter Steven Xu

    (@stevenxu)

    https://teachers.domain.com/user1/files/2014/11/video.m4v”
    this link works on computers’ browser, but not for iPad,any different between them?

    I don’t have http.conf file, only apache2.conf. all “AllowOverride” in apache2.conf have set to All.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    There really shouldn’t be a difference between ipad and a grown up computer.

    Have you flushed Safari’s cache on the ipad?

    Thread Starter Steven Xu

    (@stevenxu)

    Yes, I flushed the Safari cache on ipad, and try google chrome on ipad, the same problem.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Does your site use a different theme on mobile devices, or is the theme responsive?

    Thread Starter Steven Xu

    (@stevenxu)

    Thanks Mika
    my site use the same theme on ipad.

    I’ve told the users to edit the embed video code to make the video works on iPad. it may not be the best way, but this method helped.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    If you go to the ‘bad’ URL directly on the ipad, what happens?

    Thread Starter Steven Xu

    (@stevenxu)

    If I go to https://teachers.domain.com/user1/files/2014/11/video.m4v on ipad browser, the opened page is black with a play button in the middle. and one disabled symbol on the play button.

    If I go to https://teachers.domain.com/wp-content/blogs.dir/100/files/2014/11/video.m4v, I opened the video page,video can play normal.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Something’s being restricted on the server side. You’ll have to delve into your server’s PHP error logs ??

Viewing 15 replies - 1 through 15 (of 18 total)
  • The topic ‘subsite videos cannot play on ipad’ is closed to new replies.