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 3597110
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:04:34+00:00 2026-05-18T20:04:34+00:00

i am currently trying to build a html5 video page with restrictive access to

  • 0

i am currently trying to build a html5 video page with restrictive access to the videos. Therefor i want to put the videos out of web root and have some kind of script check the user account and deliver the video.

If i put a .ogv (theora) and a .mp4 (h264) file just into webroot and use a video tag with multiple source tags, they work on all tested browsers: Firefox (ogg), Chrome (ogg), IE9 (mp4), Safari (mp4), Opera (ogg)

<video id="currentVideo" controls width=640>
<source type='video/ogg; codecs="theora, vorbis"' src="http://mysite/1.ogv" />
<source type='video/mp4; codecs="avc1.64001E, mp4a.40.2"' src="http://mysite/2.mp4" />
</video>

Now the first question that comes up is: Why is chrome using the ogg format? It scrubs much faster through the timeline with mp4 videos and it does support mp4 videos… Is there a way to mark a format as ‘preferred format’?

Now if i put the files out of my webroot and use a php script like this to deliver them:

download.php:

$path=explode('/',$_SERVER['PATH_INFO']);
if (sizeof($path)>1) {
        $inf=explode('.',$path[1]);
        $id=intval($inf[0]);
        $type=$inf[1];
        $ctype='';
        if ($type=='ogv') {
                $ctype='video/ogg';
        } elseif ($type=='mp4') {
                $ctype='video/mp4';
        }
        $fname=sprintf('/var/outsidewebroot/videos/test.%s',$type);
        http_send_content_type($ctype);
        http_throttle(0.1);
        http_send_file($fname);
}

which should put out the file including support for http range queries.

HTML:

<video id="currentVideo" controls width=640>
<source type='video/ogg; codecs="theora, vorbis"' src="http://mysite/download.php/1.ogv" />
<source type='video/mp4; codecs="avc1.64001E, mp4a.40.2"' src="http://mysite/download.php/2.mp4" />
</video>

Opera is not able anymore to determine playing length of the video, and even worse: google chrome (and its free clone iron) hang (mac and windows) – chrome itself remains running, but the tab loading the site is locked

  • 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-18T20:04:35+00:00Added an answer on May 18, 2026 at 8:04 pm

    Is there a way to mark a format as ‘preferred format’?

    List them in order of preference. You have ogg first, so it is taken as preferred.

    <video id="currentVideo" controls width=640>
    <source type='video/mp4; codecs="avc1.64001E, mp4a.40.2"' src="http://mysite/2.mp4" />
    <source type='video/ogg; codecs="theora, vorbis"' src="http://mysite/1.ogv" />
    </video>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am currently trying to build a html5 video page with restrictive access to
I'm trying to build an ASP.NET page that can crawl web pages and display
I'm currently trying to build a personal website to create a presence on the
I'm currently trying to build a simple component which should monitor, if the user
I am currently trying to build on TeamCity, which uses Microsoft.Office.Interop dll. This will
I'm currently trying to build an application that inherently needs good time synchronization across
I'm currently trying to build a more or less complete set of unit tests
I am currently trying to build a very basic serial shell with my arduino.
I am trying to build an API that gives data on various cities. Currently,
I'm trying to build firefox but I'm having some problems. I currently have Visual

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.