Dodano preverjanje za ogg predvajanje

master
Jure Podgoršek 2018-06-06 01:26:43 +02:00
parent fb6db9d53f
commit 919646e70d
3 changed files with 15 additions and 2 deletions

View File

@ -218,6 +218,10 @@ window.addEventListener("mousedown", () => {
document.body.style.cursor = "none"
document.getElementById("navodila").style.display = "none"
if (!Modernizr.audio.ogg) {
document.getElementById("fejl").style.display = "block"
}
if (!document.zacetek) {
document.zacetek = true
zacetek()

View File

@ -32,9 +32,12 @@
margin-top: 4rem;
text-align: center;
}
#fejl {
margin-top: 3rem;
text-align: right;
display: none;
}
</style>
<script src="node_modules/babel-polyfill/dist/polyfill.min.js"></script>
<script src="animacija.js" type="text/javascript"></script>
</head>
<body>
<span id="crka"></span>
@ -48,6 +51,11 @@
<p>3. Pozor! Ogled avdio-vizualizacije lahko sproži epileptični napad.</p>
<p id="zacetek"><strong>&#128432;</strong> Kliknite kjerkoli za začetek</p>
<p id="fejl">* Ker imate zastarel spletni brskalnik, boste priča zgolj vizualni podobi in ne potrebujete slušalk</p>
</div>
</body>
<script src="node_modules/babel-polyfill/dist/polyfill.min.js"></script>
<script src="modernizr.js"></script>
<script src="animacija.js" type="text/javascript"></script>
</html>

1
modernizr.js 100644
View File

@ -0,0 +1 @@
!function(e,n,a){function o(e,n){return typeof e===n}function s(){var e,n,a,s,t,c,r;for(var u in l)if(l.hasOwnProperty(u)){if(e=[],n=l[u],n.name&&(e.push(n.name.toLowerCase()),n.options&&n.options.aliases&&n.options.aliases.length))for(a=0;a<n.options.aliases.length;a++)e.push(n.options.aliases[a].toLowerCase());for(s=o(n.fn,"function")?n.fn():n.fn,t=0;t<e.length;t++)c=e[t],r=c.split("."),1===r.length?Modernizr[r[0]]=s:(!Modernizr[r[0]]||Modernizr[r[0]]instanceof Boolean||(Modernizr[r[0]]=new Boolean(Modernizr[r[0]])),Modernizr[r[0]][r[1]]=s),i.push((s?"":"no-")+r.join("-"))}}function t(e){var n=u.className,a=Modernizr._config.classPrefix||"";if(p&&(n=n.baseVal),Modernizr._config.enableJSClass){var o=new RegExp("(^|\\s)"+a+"no-js(\\s|$)");n=n.replace(o,"$1"+a+"js$2")}Modernizr._config.enableClasses&&(n+=" "+a+e.join(" "+a),p?u.className.baseVal=n:u.className=n)}function c(){return"function"!=typeof n.createElement?n.createElement(arguments[0]):p?n.createElementNS.call(n,"http://www.w3.org/2000/svg",arguments[0]):n.createElement.apply(n,arguments)}var i=[],l=[],r={_version:"3.6.0",_config:{classPrefix:"",enableClasses:!0,enableJSClass:!0,usePrefixes:!0},_q:[],on:function(e,n){var a=this;setTimeout(function(){n(a[e])},0)},addTest:function(e,n,a){l.push({name:e,fn:n,options:a})},addAsyncTest:function(e){l.push({name:null,fn:e})}},Modernizr=function(){};Modernizr.prototype=r,Modernizr=new Modernizr;var u=n.documentElement,p="svg"===u.nodeName.toLowerCase();Modernizr.addTest("audio",function(){var e=c("audio"),n=!1;try{n=!!e.canPlayType,n&&(n=new Boolean(n),n.ogg=e.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),n.mp3=e.canPlayType('audio/mpeg; codecs="mp3"').replace(/^no$/,""),n.opus=e.canPlayType('audio/ogg; codecs="opus"')||e.canPlayType('audio/webm; codecs="opus"').replace(/^no$/,""),n.wav=e.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),n.m4a=(e.canPlayType("audio/x-m4a;")||e.canPlayType("audio/aac;")).replace(/^no$/,""))}catch(a){}return n}),s(),t(i),delete r.addTest,delete r.addAsyncTest;for(var f=0;f<Modernizr._q.length;f++)Modernizr._q[f]();e.Modernizr=Modernizr}(window,document);