Having a YouTube Video in Fullscreen Mode as a Background with No Sharing, Watch Later, Icons, or Playback

import React from "react";
import tree from "../components/tree";

function HomePage() {
  return (
    <div className="screen">
    <div className="videoContainer">
      <iframe className="videoContainer_video" width="1920" height="1080" src="https://www.youtube.com/embed/ByG3b0nIT_M?modestbranding=1&control=0&autoplay=1&showinfo=0&autohide=1&modestbranding=1&fs=0&loop=1&rel=0" frameborder="0" allow="autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>"
    </div>
    </div>
  );
}

export default HomePage;
.videoContainer {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

iframe {
    width: 100%;
    height:100%
}

.screen {
    position: fixed;
    z-index: -99;
    width: 100%;
    height: 100%;
}

https://i.sstatic.net/KoD2H.jpgI'm currently developing a project that requires the usage of a YouTube video as a fullscreen background for the webpage. After reading numerous articles and attempting different solutions, I have only been successful in removing the control bar while leaving other elements like icons on the sides and start button intact. The project is built with react and my goal is to have the page load with the video as the sole fullscreen background element. Any assistance would be greatly appreciated. Thank you.

Answer №1

The reason for this is that YouTube embedding links come with these built-in features by default. You can verify this by checking out this /embed/ example. To address this, you'll need to update your src link or use CSS selectors to exclude the button tags associated with classes like ytp-share-button and ytp-watch-later-button. An example of how to do this is...

.ytp-share-button {
  display:none
}

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

Loop through an array in JavaScript and only display values that are not repeated

I have a challenge where I want to display only unique values in a for loop. The data is fetched from a MySQL database and currently, all values in the column (Book Name) are being displayed. However, I aim to show only unique values and eliminate any du ...

Focusing on styling specifically for Chrome rather than Safari using SCSS

Is there a method to specifically target only Chrome browsers within a mixin in SCSS? @mixin { &:after { border-bottom:black; @media screen and (-webkit-min-device-pixel-ratio:0) { border-bottom: red; } } } Currently, this code targets bot ...

Having trouble getting the new dynamic bootstrap card to function properly

I'm struggling to add a new bootstrap card to my page. Every time I try to insert it, the card doesn't show up. Here is the code snippet: Show a new bootstrap card if a record exists <div class="row"> <button type="button" ...

Printing content from an Angular dashboard can be achieved by following a few

Currently, I am working on developing a legal document automation program for my company. However, I have encountered an issue during the final stages of completing this web application. For the layout and setup, I am using the default angular Dashboard l ...

Retrieve a specific item from the JSON dataset

Currently, I am in the process of working on my own project using jQuery, AJAX, and JSON. My goal is to retrieve data from the TMDB API by allowing users to search for a specific term, such as the movie "Fight Club." The desired outcome is to display a mov ...

Ways to determine if a browser is currently loading a fresh webpage

I'm experiencing an issue with my web app where the 'safety' code triggers a page reload if the server (Socket.IO) connection becomes silent for more than 5 seconds, often due to customer site firewall or broken-proxy issues. Although the S ...

Having difficulty formatting a div using HTML/CSS in a React application

As I embark on my journey to learn HTML/CSS, I am experimenting with different examples. Currently, I am struggling to create a div that resembles what I envision due to the content being 'glued' together. I have attempted various methods, but n ...

What is the alternative to $templateCache in Angular2 and how can CachedResourceLoader be utilized in its place?

While I have come across 2 similar questions on Stack Overflow and here, none of them seem to provide a solution. After delving into the Angular repository, I stumbled upon this issue where they inquire about an alternative for templateCache in Angular 2, ...

Extract information from a webpage containing various tabs through web scraping

My goal is to extract information from this specific page. Upon loading, the page defaults to the first Tab. I have successfully scraped data from this initial tab without issues. However, I now need assistance in navigating programmatically to the second ...

Troubleshooting in WebStorm: Uncovering the Root Cause Within an npm Package (node:36378) [DEP0005] - Warning: Deprecation Warning

Over the past 6 months, I've been encountering an error that seems to have surfaced after an update to node.js. (node:36378) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), ...

Implementing a Standardized Template for Consistent Design and styling Throughout Website

As I work on building my website, I find myself struggling with some of the intricacies. The homepage is set up with a navbar and header, along with several pages that can be easily navigated to. While everything seems to be functioning properly, upon ins ...

Angular Link function encounters scope undefined issue

I've been struggling with this issue for some time now. Imagine I have the directive and controller setup as shown below: angular.module('LiveAPP.artist',[]) .controller('artistCtrl', ['$scope', '$http', ' ...

Is it possible to incorporate HTML code blocks like headers and footers on all pages using the ejs templating engine in Node.js?

Is it possible to achieve a similar result as in PHP? For instance, if I have a header.ejs file which includes the following code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"/> <title>Tit ...

What is the best way to expose services beyond the constructor in Angular?

I'm facing an issue with my code. In Ionic with Angular, I usually access Angular services in the constructor after injecting them like this: export class HomeController { static $inject = [ '$scope', '$state' ...

Error message: In Redux/React, it is required that actions are plain objects. For asynchronous actions, custom middleware must

Here is the code I used to create a store: import { createStore, applyMiddleware } from 'redux'; import { logger } from 'redux-logger'; import rootReducer from './reducers/rootReducer'; import { compose } from 'redux&a ...

Tips for showing HTML content in an Angular UI grid

I've been attempting to showcase HTML within the grid by checking out this resource: Add html link in anyone of ng-grid However, my attempts led me to this code snippet: var app = angular.module('myApp', ['ngGrid']); ...

jQuery SlideDown Navigation

Is there a way to implement jQuery code that will display dropdown menu options when the Trials link is clicked? Update: jQuery(document).ready(function () { $("a[href='http://sheep.local/cms/trials']").click(function(e){ e.prevent ...

In strict mode, it is not allowed for an object literal to contain duplicate property names

Here is the code snippet I am having trouble with: import { combineReducers } from 'redux'; import { postReducers } from './postReducers'; import { stationsReducer } from './TrackCircuitSensorDataFormReducers/StationsReducer' ...

JavaScript code to enforce a 100% page zoom setting

After developing a small game in Canvas, I encountered an issue. Some users with their default zoom level set to something other than 100% are unable to view the entire game page. I attempted to resolve this by using the following CSS: zoom: 100%; This ...

What happens when arithmetic operators are applied to infinity values in JavaScript?

Why do Arithmetic Operators Behave Differently with Infinity in JavaScript? console.log(1.7976931348623157E+10308 + 1.7976931348623157E+10308)//Infinity console.log(1.7976931348623157E+10308 * 1.7976931348623157E+10308)//Infinity console.log(1.797693134 ...