Got a bit of a weird issue. I am using Audio.js to play some audio files.
Across all platforms and all browsers everything works perfectly apart from Firefox for Mac. The files just do not want to play. They download OK and Audio.js outputs thats they have fully downloaded, but will not play. I have tried files uploaded to our cloud storage provider (they stream fine on all the other browsers), the same files served locally and a third party .ogg file found online.
Nothing.
Anyone had issues with .ogg files playing on Firefox for Mac? Would it be a files header issue? Anyone had issues with Audio.js having problems playing .ogg files in FF on a Mac?
From the docs, ogg vorbis files are not supported. Also, the implementation needs flash in Firefox to work it seems: kolber.github.io/audiojs
(Since your test-case works only in FF on Windows, and not FF on OSX):
FF on Windows can use OS-level MP3 implementation, whereas FF on OSX does not have access to the MP3 codec freely.. not sure if that's what's causing it, but it could be used for the feature detection in the library (as it is an OGG)
Related
I’m currently working on a web application whose main purpose is streaming/timeshifting TV channels. Application is written in Javascript React framework and for web player we are using CookPete ReactPlayer with integrated hls.js. We have managed to successfully play live TV channels but unfortunately, we are experiencing some issues with timeshifting channels
Live streams are distributed over XtreamUI server as a m3u8 lists, and have this kind of format
example.org/live/username/password/channel_1.m3u8
So when a user is watching Live TV this kind of URL goes to the player source and CookPete player + hls.js are doing their magic with parsing/processing m3u8 list which results in playing video flawlessly.
Here comes the problem, for timeshift XtreamUI are using this kind of URL example.org/streaming/timeshift.php?username=XXX&password=XXX&stream=2&start=2020-04-26:19-23&duration=7
As you can see its PHP script which STREAMS raw bytes into the player. Here are response headers from /streaming/timeshift.php
As you can notice, the Content-type is video/mp2t which for some reason cannot be played in the browser environment.( Google Chrome, Mozilla Firefox, IE 11). This warning pops up.
On the other hand, Safari browser on Mac video is playing completely normal, but the request from Safari is a little bit different. This is a screenshot from Safari's console network tab. As you can see there are several requests with different byte-ranges.
We are seeking a solution which will provide playing timeshift video (video/mp2t content) in Google Chrome, Mozilla Firefox and IE 11. All suggestions/advices are welcome.
the Content-type is video/mp2t which for some reason cannot be played in the browser environment
This is because chrome and Firefox do not support mpeg transport streams, and safari does. hls.js works because it knows how to read a binary ts file, and rewrite it as mp4 fragment before sending to the the media source extensions buffer. You will need to do the same. Take a look at mux.js.
In Firefox install a codec by running this command.
sudo apt-get install libavcodec58
Install a similar codec in chrome too. It should fix the problem.
I am building an HTML5 web game, a spin on the classic asteroids game to be precise. The problem I'm running into is that Safari, unlike Chrome or Firefox, will NOT automatically cache and use .wav sound files. This is causing substantial lag if there are an abundance of sounds occurring. On each instance of needing a "shooting" sound, the browser will perform a new GET request to obtain the audio file, as seen below:
you will see that the 151013__bubaproducer__laser-classic-shot-2.wav is the shooting sound that is being requested through the network over and over again and is not being cached. In an attempt to force Safari to cache this file, I've created an Asteroids.manifest file for the appcache to utilize:
Yes, that is the correct directory location relative to both the index.html as well as the Asteroids.manifest. And the manifest file does appear to be consumed, as it is visible in Safari's debugger storage:
Please let me know if you have any suggestions, as I've tried a variety of different setups of the .manifest file, including naming it .appcache, ensuring that it is served up with a MIME type of text/cache-manifest, and removing the NETWORK/CACHE/FALLBACK fields
Edit note: the window.applicationCache.status() is 1 (Idle)
I think that Safari doesn't cache audio files even if listed in the manifest file. Have you tried encoding the audio as BASE64 string and decode/convert back to audio at startup? Have a look at the WepApi, it can probably help you with that process.
If you mean mobile, then there are some posts here: HTML5 offline video caching in mobile safari
In summary, there is an ~5mb limit for the cache in mobile Safari. There may be something similar on the desktop. Another poster said that audio & video are not cached by the iPhone since they are played by external applications. It seems the only workaround is to store them as base64 in the local database (or local storage perhaps also? - Just keep in mind that "in private" browsing disables it).
If not, perhaps something to consider if you do plan to target the mobile version.
I try to play sounds with "Howler.js", but it's not working in FF in every other browser it works.
To test if it is a problem with the sound files I opened the directory containing the files with the browser.
I have a '.mp3' file, a '.ogg' file, a '.wav' and a '.webm' file.
In FF none of them are working, FF only gives me the message "Video could not be played, because the file is broken.".
Now I'm totally confused, because other browsers don't complain about the audio files.
I appreciate any help.
Found a solution myself. The problem was that I started the Code via node and gulp, which resulted in wrong mime types, which was a problem for Firefox. When the application is started via apache, the mime types are correct and everythings working fine.
I have a web video player that plays mkv and mp4 videos, everything runs well on google chrome but firefox only plays mp4 ones, when I try to click one of mkv videos it says: Video format or MIME type is not supported this is my video script, just in case you need it to find out what's wrong: http://pastebin.com/Vrvqt8wq
So what could be the problem ?
Firefox simply does not support Matroska natively, except for the subset of it that is WEBM.
As far as I know, Chrome does not officially support or endorse Matroska either, but it happens to work.
I can't find a way to play back audio in any recent browser, using javascript, especially if I want to be able to distribute an audio encoder to create the audio files (which forbids mp3 format). The audio files could be either on the server or stored locally. The issues are:
Using the HTML5 audio tag, with a flash fallback libraries (such as jplayer, soundmanager2 or projekktor) is easy but the only format that would work anywhere is mp3.
I could use speex/flv but it would only work with flash, forbidding iphone/ipad.
A plain wav file would not work on IE 8, 7, 6
A reasonable list of recent browser to be supported is: IE 8-9, FF 4, Chrome 11 and safari 4, including on iphone/ipad.
The only solutions I would see would be to implement a wav file player in flash, as suggested here (but I would have to learn how to program actionscript), or to encode the files in a free format, upload them, and re-incode them to MP3 on the server (but lot of server CPU load).
Do you know any solution without these drawbacks?