Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/testing/web-platform/tests/common/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  media.js   Sprache: JAVA

 
/**
 * Returns the URL of a supported video source based on the user agent
 * @param {string} base - media URL without file extension
 * @returns {string}
 */

function getVideoURI(base)
{
    var extension = '.mp4';

    var videotag = document.createElement("video");

    if ( videotag.canPlayType )
    {
      if (videotag.canPlayType('video/webm; codecs="vp9, opus"') )
      {
          extension = '.webm';
      }
    }

    return base + extension;
}

/**
 * Returns the URL of a supported audio source based on the user agent
 * @param {string} base - media URL without file extension
 * @returns {string}
 */

function getAudioURI(base)
{
    var extension = '.mp3';

    var audiotag = document.createElement("audio");

    if ( audiotag.canPlayType &&
         audiotag.canPlayType('audio/ogg') )
    {
        extension = '.oga';
    }

    return base + extension;
}

/**
 * Returns the MIME type for a media URL based on the file extension.
 * @param {string} url
 * @returns {string}
 */

function getMediaContentType(url) {
    var extension = new URL(url, location).pathname.split(".").pop();
    var map = {
        "mp4" : "video/mp4",
        "webm""video/webm",
        "mp3" : "audio/mp3",
        "oga" : "application/ogg",
    };
    return map[extension];
}

Messung V0.5
C=94 H=98 G=95

¤ Dauer der Verarbeitung: 0.4 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.