mirror of
https://github.com/classilla/tenfourfox.git
synced 2025-02-18 21:30:42 +00:00
36 lines
703 B
JavaScript
36 lines
703 B
JavaScript
//
|
|
// Returns the URI of a supported video source based on the user agent
|
|
//
|
|
function getVideoURI(base)
|
|
{
|
|
var extension = '.mp4';
|
|
|
|
var videotag = document.createElement("video");
|
|
|
|
if ( videotag.canPlayType &&
|
|
videotag.canPlayType('video/ogg; codecs="theora, vorbis"') )
|
|
{
|
|
extension = '.ogv';
|
|
}
|
|
|
|
return base + extension;
|
|
}
|
|
|
|
//
|
|
// Returns the URI of a supported audio source based on the user agent
|
|
//
|
|
function getAudioURI(base)
|
|
{
|
|
var extension = '.mp3';
|
|
|
|
var audiotag = document.createElement("audio");
|
|
|
|
if ( audiotag.canPlayType &&
|
|
audiotag.canPlayType('audio/ogg') )
|
|
{
|
|
extension = '.oga';
|
|
}
|
|
|
|
return base + extension;
|
|
}
|