Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4084332
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:25:35+00:00 2026-05-20T18:25:35+00:00

I know one difference between ogg video and mp4 video is that ogg video

  • 0

I know one difference between ogg video and mp4 video is that ogg video doesn’t have metadata describing the file size, so when an ogg video is loaded, the controls can’t show the time remaining until the file has fully loaded. This can be a problem if the ogg video is more than a few minutes long. Is there a way to get this filesize when the page is requested?

(Client-side developer, asking a question that I think has a server-side answer. I welcome suggested edits to this question, if you can think of a way to ask it more specifically.)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T18:25:36+00:00Added an answer on May 20, 2026 at 6:25 pm

    Well although not the most direct, you could try this.

    First, set up a .htaccess to transparently grab all .ogv videos and process them with PHP

    .htaccess

    RewriteEngine On
    RewriteRule ^(.*)\.ogv$ ogv.php?file=$1
    

    ogv.php

    <?php
    $file = $_GET['file'] . '.ogv';
    
    while ( strpos($file, '..') !== false )
    {
        $file = str_replace('..', '', $file);
    }
    
    $filesize = filesize($file);
    
    header("Content-Type: video/ogg");
    header("Content-Transfer-Encoding: binary"); 
    header("Content-Length: {$filesize}");
    readfile($file);
    exit()
    ?>
    

    HTML:

    <video src="video.ogv" id="video" controls></video>
    
    <script>
    var video_src = document.getElementById('video').src;
    var xhr = new XMLHttpRequest();
    xhr.open('GET', video_src, false);
    xhr.send(null);
    var size = xhr.getResponseHeader('Content-Length');
    alert(size);
    </script>
    

    So here’s how this system works. Just link a .ogv video like normal but the .htaccess file captures the request first and sends it to ogv.php. The PHP file then specifically sends out a file size header in case the server doesn’t automatically. Okay, that still doesn’t do you a whole lot of good, right? Well, you can then make an Ajax request for the video and extract the filesize from the HTTP headers.

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know the difference between these two statements. Is one 'better' than
I know that one of the defining principles of Test driven development is that
Does any one know of a control that i can use with a ASP.Net
I would like to know which one is the best material that I can
What are some fundamental Feature/Architectural difference between the BEAM and JVM? Yes I know:
Can some one please tell me what is the difference between vector vs deque.
I know about the difference between the base/active SDKs and the deployment target. I
I would like to know what is the difference between static variables in a
What is the real difference between these two options? What I know is: Register
does any one know how to get the current motherboard, processor or HD temperature

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.