How to ensure cross browser AAC+ playback? - javascript

I have an Icecast server serving AAC+ (HE v2). I use JPlayer in my webpage to play the content. In Chromium without Flash Player it works just fine.
For Flash enabled browsers it does not work out of the box. I read that Icecast wants to have a "type=.flv" appended to the stream request to make the content playble by Flash Player, and although I have trouble finding the Icecast documentation about it, indeed it works on Firefox with Flash Player 11. But it does not play on other browsers with Flash 15 and above, namely Google Chrome on Linux, Firefox and Internet Explorer on Windows. Google Chrome plays it just fine by disabling Flash Player.
The audio data are downloaded correctly as shown by Developer Tools, audio is heard for about one second and then silence.
Is there anything I can try to make AAC+ playback possible with Flash Player ?
A link:
http://148.251.184.14:18044/chr_xmas
By default it returns a header with Content Type audio/aac. By appending "?type=.flv" (with a dot), it returns Content Type video/x-flv.

Turns out this is a jPlayer issue. I noticed at the bottom a mention by a jPlayer fork with a crude hack which is good enough for my purposes.
It didn't work right off the bat though, I changed the line to
if( myStream.bytesLoaded > 2048 ) return 1;
as it seems that in my case bytesTotal was not uint.MAX_VALUE. I had to compile a new .swf with flex and it worked like a charm on Firefox and Internet Explorer.

Related

Jwplayer video not working in chrome

We are sharing jwplayer videos on facebook. The vidoes played fine on all other browser except chrome.
Please share below link on facebook on chrome and play the video, you will see player is disorderd and video is not played.
http://isp-dev.deliveredoncloud.com/facebook-video?v_key=atHlbXDD
The link is verified on facebook and OG debugger, it return response:206.
Any help, why video is not played in chrome.
player condition in chrom when played
From the error in your comments it looks like Chrome is enforcing content security policies.
These are described quite well here: https://developer.mozilla.org/en-US/docs/Web/Security/CSP/CSP_policy_directives and here: http://content-security-policy.com
Note in particular the browser support table in the first link (this will hopefully be updated regularly so is not a good thing to show here as it would just be a current snapshot).
You can experiment wit different settings, maybe trying a very open policy initially to make sure this is not masking some other issue.

Weird issue about audio tag in firefox.

I have an audio tag in my html and it works in chrome. However, I have trouble in FF ver.25.
The source is mp3 but I know FF is now supporting mp3 file. I also copy and paste the mp3 file path on FF address bar and it plays. It just doesn't work in my audio tag.
Symptom:
Audio control bar will appear 1 sec when page first loads but disappear right away. It works in Chrome.
codes:
this.audioElement = createElement('audio', {className:'audio',type:'audio/mpeg',
src:'test.mp3'});
this.audioElement.setAttribute('controls',true);
I can see the audio tag appear in developer's tool but for some reason it is hiding from the page and I am sure there is no dispay:none for the tag.
Can anyone help me about it? Thanks!
Mozilla's documentation on MDN indicates that this is probably an OS-specific problem. Specifically,
To avoid patent issues, support for MPEG 4, H.264, MP3 and AAC is not built directly into Firefox on desktop and mobile (Android and Firefox OS). Instead it relies on support from the OS or hardware.
The documentation then goes on to list Windows 7+, Windows Vista, Android, and Firefox OS as those OSes which support the audio tag. Do you happen to be using OS X or some other *nix flavor? I know at least on Linux, although Firefox is able to play MP3 files directly via Totem, the audio tag with just an MP3 source has the behavior you describe.

YouTube API - video plays, but functions like playVideo and seekTo don't work in IE9

My site uses the YouTube API to embed a video, and relies on being able to use Javascript to play, pause, and seek through the video.
Currently, the site works in Chrome, Firefox, and IE10. However, I have problems in IE9.
In IE9, the video player correctly plays. However, the player object is somehow corrupted.
When the video is playing, player.getPlayerState() should return 1. When the video is paused, player.getPlayerState() should return 2. This is indeed correct in FF, Chrome, and IE10.
However, in IE9, player.getPlayerState() returns -1 regardless of whether it is playing or stopped. In addition player.playVideo() and player.pauseVideo() do not seem to do anything.
What's interesting is even in IE8, the player.getPlayerState(), player.playVideo(), player.pauseVideo() work fine. It's ONLY in IE9 that the problem exists.
I would appreciate any relevant information or ideas as to where to debug this problem. Thanks in advance!
EDIT: Just to update, I've tested this on a separate (friend's) machine, too.
============================
Here is an external link to the site in question, for visual reference.
http://tabless.net/tabs/50/t/Blink-182-All-The-Small-Things/
To test, just click the play button to toggle play/pause. Or you can use spacebar.

Facing an issue of double sound on Google chrome while running Edge animation

I have created an animation in Adobe Edge animate itself and its working fine on the browser. Next thing I have added a voice over to the animation which is completely synced and running perfectly using j-query.
Here's the problem which i am facing - while running the animation on the Google Chrome and Safari, I am getting double sound which is annoying. I have discovered on internet that Google chrome supports MP3, OGG, WAV formats for the audio. And Mozilla supports the OGG format. I have connected the two formats with animation using j-query which are MP3 and OGG format. And Google Chrome is reading the both formats which is creating an issue.
Please help me out to remove the double sound issue in Chrome.
Regards
Vikas Sharma
instead of using an <audio> tag, you might try using the html5 audio object and manipulating it with javascript.
here's an example:
var audiophile = new Audio();
audiophile.src = 'audiofile.mp3';
audiophile.play();
that way you're only referencing one source file, and there's no chance of two playing simultaneously.
hope this helps.

video on Safari 6 slows down whole page when my javascript form is inserted into the DOM

I'm actually developing a simple web site for the company I'm working in.
Every page has a central video, and every thing's fine on FireFox Opera Chrome and IE 9 BUT NOT with Safari 6.0.1 (Mac) neither with Safari 5.1.7 (PC) (it's OK with Mac Safari 5.1.2).
I've already tried to deactivate any other scripts, removed every video attributes, i even rewrote my scripts in a OOP way but ain't got any result at this point.
The fact is, as soon as i try to remove the mp4 source, the whole page runs perfectly.
Test site is visible here : http://www.jsteitgen.com/tests/
I've read a few posts in forums, about a Safari bug when accessing YouTube player. That might be the same problem but couldn't find any confirmation yet.
I wonder if anyone has experienced the same thing / would know something i don't about Safari 6 specifications / or even better : would have a solution !
Hope my English will be clear enough to get answers.
Taking a look on the code on the site which looks similar to the one on "http://drupal.org/node/1536226":
<source src='vids/animLogo.mp4' type='video/mp4' /><!-- Safari /iOs Video -->
<source src='vids/animLogo.ogv' type='video/ogg' /><!-- FireFox / Opera / Chrome -->
<source src='vids/animLogo.wmv' type='video/x-ms-wmv' /><!-- WIndows Media Viedo -->
There are 3 different video files being served. Of course, webm and theora are not supported on the versions of safari that are mentioned in the question, (SOURCE: http://weblogs.mozillazine.org/asa/archives/2009/03/open_video_in_s.html, http://farukat.es/journal/2011/01/488-google-h264-and-video-web, http://farm6.static.flickr.com/5285/5349294818_e6e32d42db_o.png) which prevents the ogv file from being played in safari, without additional plugins from the user (SOURCE: http://www.broken-links.com/2010/09/01/playing-webm-in-safari-with-plugins/, http://blog.andikurnia.com/2010/11/29/playing-ogg-files-directly-from-safari/). With further inspection, the .mp4 file is 3 times larger then the video formats being delivered to firefox, opera and chrome.
My suggestion is to optimize the .mp4 file to make the data being streamed alot less, since the embedded size (720x423) is smaller then the video's dimensions (1280x720), but that a matter of quality vs preformance of site.
Also, to answer your question, there is no youtube player, it mostly has something to do with video codecs and apple's implementation of it, safari does not have native support of Theora and thus, it resorts to the .mp4 verson unless codecs or plugins are avaliable to "decode" the file.
In short, the higher quality and slow video is being played. which needs to be compressed and optimized in order for the website to run a little more smoothly.

Categories