The HTML 5 video is not functioning properly on an iPad, and the layout of the iPad has black areas on the sides

Having some trouble with an HTML 5 project where the video plays on Chrome and Safari PC browsers but not on iPad. The task at hand is to get it working in portrait mode only, with the video playing when tapped/clicked.

<!doctype html>
<!--[if lt IE e 7]>    <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en">  <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8" lang="en">         <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9" lang="en">                <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en">                       <!--<![endif]-->
    <head>
        <meta charset="utf-8">
        <title>Page 1</title>
        <meta name="description" content="">
        <meta name="viewport" content="width=768px, minimum-scale=1.0, maximum-scale=1.0"   />
        <style>
            #container{
                width:768px;
                margin:150px auto;
                position: relative;
            }
            #container video {
                position:relative;    
                z-index:0;
            }
            .overlay {
                position:absolute;
                top:170px;
                left:380px;
                z-index:1;
            }
        </style>

        <script>
            function play(){
                var video = document.getElementById('video');
                video.addEventListener('click',function(){
                    video.play();
                },false);
            }
    </script>

        <script>
            $(document).ready(function () {
                function reorient(e) {
                    var portrait = (window.orientation % 180 == 0);
                    $("body > div").css("-webkit-transform", !portrait ? "rotate(-90deg)" :       "");
                }
                window.onorientationchange = reorient;
                window.setTimeout(reorient, 0);
            });
        </script>
    </head>
    <body>
        <div id="container">
            <video id="video" width="770" height="882" onclick="play();">
                <source src="video/Motionv4-1.m4v" />
            </video>
            <div class="overlay">
                <div style="color:#356AFA; text-align:center; font-weight:bold; font-size:45px; line-height:60px; font-family:arial">
                    Tap the <br /> DoughBoy<br />to Join<br /> JavaWorld<br /> Wi-Fi!
                </div>
            </div>
        </div>
    </body>
</html>

Answer №1

Dealing with a similar issue during my project work was challenging.

To resolve it, I turned to jwplayer for assistance.

Answer №2

There is a known issue with iPads where they only recognize the first MIME type provided, so make sure to add your .mp4 file first in order for it to work correctly.

For additional information, you can visit this website:

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

"Commander.js does not process query strings when used in conjunction with node

I developed a CLI tool using commander.js which has been released on npm. This command-line interface utilizes node-fetch to fetch data from an external API. However, I have received reports from some users stating that the query string in the fetch URL is ...

Aligning variable width numbers within a div container

Currently experimenting with CSS to create a calendar design that mimics the look of a traditional paper calendar. One issue I've encountered is the alignment of numbers within boxes, especially when dealing with double digits. When displaying a sing ...

Search through a JSON object, identify all keys that start with the same letter, and transfer them to a new JSON data structure

I am looking to iterate through my JSON data and extract all keys along with their values that start with the letters "QM". Below is an example of my JSON content: [ { MHF46: 'Ledig', MHF181: '06', QM6_QMSI2: '1899-12-30 ...

Converting a JavaScript array into JSON using PHP

After analyzing the text, I was trying to figure out how to convert it into json format using php's json_decode function. Unfortunately, when I used json_decode on this text, it returned a syntax error. $arr = json_decode($str, true); {1: {name: &ap ...

Using Node.js to send instructions to an HTTP server in order to highlight or add color to specific elements within

I have set up a server that receives data from a gaze sensor, as well as an HTTP server that serves an HTML page. I am looking for a way to dynamically highlight elements in the HTML based on the incoming data. Any suggestions on what resources or techniqu ...

What is causing Firefox to display an additional line in this section?

After much effort, I've been attempting to eliminate the extra spacing on this page in Firefox: Do you see the menu? If you compare it to Chrome, you'll notice that the menu is positioned too low beneath the background, giving the layout a broke ...

Iterating through objects in an array using JavaScript should only happen after the current object

As an illustration: Starting from [x0,x1,x2,x3] - x0 compares itself to x1,x2 and x3. x1 compares itself to x0, x2 and x3. And so forth... To [x0,x1,x2,x3] - x0 compares itself to x1,x2 and x3. x1 compares itself to x2 and x3 only. x2 only compares ...

Using Three.js to seamlessly transition from one Panorama Cube to another with a smooth zoom-in effect

As a newcomer to Three.js, I am currently experimenting with an example featuring a set of 6 image cubes for a panorama effect. This allows users to pan, zoom in, and zoom out around the cubes. If you're interested, you can check out the example here ...

Utilize puppeteer by passing a function inside page.waitForFunction() for efficient automation processes

Below is the code I am using: function checkDataRefresh(pastAvgGain, currentAvgGain) { if (pastAvgGain !== currentAvgGain) { return true; } else { return false; } } async function fetchInformation(pair, page) { let pastAvgGain = C.AVG ...

Sophisticated Arrangement of Div Elements

Here's a scenario where Two divs are dynamically styled from the Database. I am attempting to align two divs in the layout shown here: https://i.stack.imgur.com/nYI7v.png Can this be achieved using Bootstrap's CSS class col-? In responsive mo ...

Loop Through Mongoose to Retrieve Multiple Objects

I am currently facing an issue while trying to retrieve multiple objects from MongoDB using mongoose. In my database, I have two primary collections known as user and order. The user collection consists of an array called 'order history', which ...

Using regular expressions in PHP to identify HTML elements containing '<p>' that appear after the initial '<H1>' tag

Can you provide guidance on creating a Regular Expression in PHP to identify HTML <p> elements that come after the initial <H1> tag? Here's an example that checks for inequality with the expression: if(!preg_match_all('#<p(.*?)&l ...

What is the reason for Javascript XMLHttpRequest returning the octet-stream MIME type response as a string instead of binary

My attempt to retrieve a gltf binary file using the XMLHttpRequest method was unsuccessful. Below is the code I used. var xhr = new XMLHttpRequest(); xhr.open("GET","THE ADDRESS",true); xhr.setRequestHeader("Accept", "application/octet-stream"); xhr.respo ...

Uh-oh, the Next.js fetch didn't go as planned. The error message

Currently, I am using Next.js 14 for my project. Suddenly, there has been an issue where some images are not loading on my local setup. However, the images load fine on the preview and production branches on Vercel. Upon checking my console, I noticed th ...

React-modal triggers the file-explorer upon exiting the dropzone

Within my project, I have implemented a button that triggers a modal to appear on mouse-over. This button is nested inside a dropzone element. https://i.sstatic.net/95dxy.png The issue arises when I exit the modal by clicking (not exiting with the escape ...

Can you show me the steps for downloading the WebPage component?

My goal is to save webpages offline for future use, but when I download them as html many of the included components disappear! I attempted opening them in a WebBrowser and downloading as html with no success. One potential solution is to download the ht ...

What is the best way to navigate back on a button click in jquery AJAX without causing a page refresh?

Is there a way to navigate back without refreshing the page? I am fetching data dynamically using AJAX, but when I try to go back using the browser button, it takes me all the way back to the starting point. Let's look at the situation: 3 Different ...

Integrating tilt and zoom functionality on a web page based on mouse movements

While browsing through some messages on chat, I came across something interesting: I noticed that as I moved my mouse left or right, the content would tilt in that direction, and when moving up and down, the content would zoom in or out. It was a really c ...

Remove identical options from the dropdown menu

After hard-coding and adding items to the dropdown list for team size, such as 1, 2, 3, I am encountering an issue when loading it for editing or updating. Duplicate values are appearing in the list: 1 1 2 3 4... How can I remove these duplicate value ...

How can I retrieve an array from an object containing both a property and an array in TypeScript?

One of my objects always consists of a property and an array. When I use the console.log(obj) method to print it out, it looks like the following example: ProjectName: MyTest1 [0] { foo: 1, bar: 2} [1] { foo: 3, bar: 4} [2] { foo: 5, bar: 6} Alternat ...