skip to Main Content

I’ve been using Google Apps Script to deploy a web app, which plays videos on the side bar. The video links are from the Google Sheet. It worked until I have two files about 500mb each. The videos couldn’t play at all. When I manually reduced the file size, it worked. But it’s inconvenient to do so everytime. So I was wondering if there’s a better way out? Thanks!

Html:

<video id="vid" controls autoplay muted>
    <source src="" type="video/MP4">
</video>

JavaScript (partial):

let source=document.querySelector('#vid > source');
source.src=e.target.options.vidID;
source.parentNode.load();

vidID holds the content of a cell in a Google Sheet column that holds the links to the videos in Drive. It is part of the codes where each row in the Sheet is recorded as a marker and used to produce an interactive map.

2

Answers


  1. It seems that it varies depending on what you are using to host your website/app. This is what Google Studio Help has to say about file size limits:

    File size limits The file size limit for most creative assets (images,
    audio, HTML, CSS, data files, JavaScript, etc.) is 10 MB.

    Video files are limited to 100 MB for upload and 60 MB for serving
    (except OGV files, which are limited to 10 MB). If your assets are
    larger than this limit, contact support for help, or your videos may
    not serve. Large video files may need to be hosted differently to
    ensure optimal performance.

    Login or Signup to reply.
  2. Yes, there is a limit to the file size of a video that can be played using the HTML5 <video> tag. The exact limit will depend on several factors, such as the browser being used, the available memory of the device, and the video codec being used.

    However, in general, most modern web browsers can handle video files up to a few gigabytes in size. For example, Google Chrome can typically play videos up to 2 GB in size, while Mozilla Firefox can handle videos up to 512 MB. However, it’s important to note that playing large video files can put a strain on the user’s device, potentially causing performance issues or even crashes.

    The size limit may vary depending on the browser, device,
    and network conditions:

    Network: File size have an impact the time it takes for the video to load and start playing.
    If the network bandwidth is limited, a large video file may take longer to load, resulting in longer buffering times,
    interruptions.

    Device: Playing large files on devices with limited processing power or memory may result in performance issues, such as freezing or crashing.

    Browser: Some older browsers may have limitations on the maximum size of a video file that can be played
    using the tag. Modern browsers generally have support for playing large video files.

    Finally, it is best to use video files that are optimized for web playback, such as MP4 files with H.264 video codec and to compress the video to a reasonable size to ensure smooth playback on different devices and network conditions.

    The spec advises the attribute preload to be set to metadata which indicates that only video metadata (e.g. length) is fetched hence better in performance.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search