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 know that one of the differences between classes and structs is that struct
What's the difference between these? I know that their type signatures are different, and
difference between web services clients results in one error in one success I have
It would great if some one letme know the difference between the reader(used in
Does anybody know the memory difference between these two? Or how one would figure
Any one of you know about the difference between ItemRenderer and Repeater. Both are
Simple question, but one that I've been curious about...is there a functional difference between
I have recently started working on Databases. I know the basic difference between Stored
I want to know the difference between these two statements. Is one 'better' than
Suppose that my index has 3 fields: title, x and y. I know one

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.