Streaming WAV files in browser from pre-signed AWS S3 URL - javascript

I have pre signed URL from Amazon S3 something like below
https://bucketname.s3.amazonaws.com/audios/myfile.wav?AWSAccessKeyId=XXXXXXXXXXXXX&Expires=1556734678&Signature=A1BL1tnidbSM6AGXYwvlA99vXEk%3D
This URL works fine and gives me the audio file. However, browser doesn't really play the file automatically and instead I have to right click, save as WAV file and they play it on my local player.
I want it to be played/streamed then and there on the browser. The browser shows default Chrome audio player, but it stays disabled.
Is there a setting in AWS for this or can I use some audio player libraries to play it or there is different way to get the URL? I have been searching this on the forums but couldn't get a solution that will work for me.
Thanks

Related

Force asset download instead of playing in browser

I'm currently using Azure Media Services and I'm unable to force a video download instead of in-browser player when clicking the "download" link generated after creating a download locator.
I've got the video.js player working fine with a streaming locator but whatever I do, it seems that I can't force a browser to download the video (well, right click and save work fine but the end user probably won't expect this to download the video directly).
Is there a working example somewhere that shows how to force a client browser download ?
I tried adding download tag to the html element but that did not help.
</i>
FYI the content-type header of the response is
video/mp4
When you click on the element it sends the request to the backend service which generates a SAS and redirects the request for blob download.
Thank you

Streaming media from AWS to the Web Browser

I have some large audio files in the S3 bucket.
I want to play them in a browser on-demand.
I don't want to firstly download the whole file and only then play it.
I want to achieve something like YouTube, where the whole video is not immediately downloaded but rather downloaded in small pieces.
Are there any native out-of-the-box solutions provided by AWS? Can a pre-signed S3 URL be used for this purpose? Do I need other services like AWS MediaLive or AWS IVS?
Also, maybe there are advanced JavaScript (browser based) players, that support this type of workflow?
Thank you.

HTML5 audio - recording saves file OK, but no sound when playing back through audio control

I have an asp.net web application that allows a user to record audio. I'm using code from https://github.com/nusofthq/Recordmp3js along with Matt Diamond's recorder files (modified for wav instead of mp3). Not sure if it matters but I'm using the updated API for mediaDevices.getUserMedia().
The recording works fine, the wav file is saved to disk, and if I listen to the file on disk I can hear the recording. However, if I try to play the audio back through the HTML5 audio control on the page, there is no sound. The length of the file matches what is on disk so I don't think it's because the audio control is unable to find the file.
I can post my Javascript if that will be helpful. I'm currently testing on localhost using Firefox. Firebug doesn't show any errors.
Please let me know if any additional information may be helpful.
Thank you!
The (quickest) solution was to reset Firefox. Wav files now play without any issues.

How does Spotify mask the audio URL and also prevent download of song mp3

I'm looking to mask the audio playing on my site so people can't download the audio files and also don't know what the url for the actual file (mp3) is
Simple answer,
YOU CAN'T
If they are listening to your audio, they have it already
You can slow them down but can't stop them.
The only thing you can do is obfuscate the process. But why bother at all?
The browsers were designed to: Serve content - which means give the content to the user. To show you how easy it is, here's how I usually grab video/audios on virtually any streaming site:
Prepare the network tab of your preferred browser debugger and let the video/audio load. Then look for it in the loaded resources. Videos are usually streamed in .flv or .mp4, and audio in .mp3. When you spot the url, open a new tab/window and open the link there. The browser will then download the file.

MediaElement.js and Amazon S3

My videos on Amazon S3 will not play through MediaElement.js. I get a black video player with the 'Download File' link. This behavior is consistent on Firefox and Chrome with a variety of video formats (MP4, MOV, OGG).
For each video, the mime type is set correctly on S3 (i.e. not application/octet-stream). When moved to my own server, the same videos load and play fine through MediaElement.js.
In Firebug > Net, I see a GET request status that returns 206 Partial Content for each video loading from S3. I tried appending a timestamp to the URLs to bust the cache, but that didn't work.
I've Googled quite a bit, but came up empty-handed. Any idea what might be the problem?
Update: I get the exact same result using Video.js, so it's obviously not limited to MediaElement.js.

Categories

Resources