Live streaming changes to https automatically - html

I am trying to get a live stream from an online radio link. When I run the URL in the browser, I get it playing but if I insert in a HTML audio player then it changes the URL from HTTP to HTTPS and does not play it.
here is an example:
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<audio controls>
<source src="http://80sbeats.cyberbeats.net:8000/stream?icy=http" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Any idea why it does not play it?

Related

HTML5 audio control greyed out when playing from external hard drive

Im trying to play mp3 files from an external hard drive connected to raspberry pi on web browser (webserver is the raspberry pi). My code is so far simply to test.
<!DOCTYPE html>
<html>
<body>
<audio controls>
<source src="kyon.mp3" type="audio/mp3">
</audio>
<p> <audio controls>
<source src="shakira.mp3" type="audio/mp3">
</audio>
<p> <audio controls>
<source src="/mnt/SEAGATE_BACKUP_1/MP3/Carly_I_Really_Like_You.mp3" type="audio/mp3">
</audio>
</body>
</html>
I can play first two mp3 but cannot play the third, I have checked permissions which seem fine.
Any idea?
I had the same problem with the python gTTS framework, and get_urls() gave me 2 translate.google.com URLs. My sound controls were also grayed out, and when I copy and pasted the URL into another tab, it gave me a 404 error. I pressed "Reload" and it worked, when I reloaded my own site that used get_urls(), the controls became normal. In short, if you use Chrome, try this:
Open it in an actual tab, and reload the page.
Reload your own server.
Hopefully, it works!
SHacker (left my login credentials on my Raspberry Pi)

Why isnt my audio working on a webpage that im working on, which is not live yet

Im working on a webpage, and im trying to have an audio file play from soundcloud, but it doesnt seem to work. it works if the src is from my computer but not from the soundcloud website.
<audio controls autoplay loop>
<source src="audio.mp3" type="audio/mp3">
<a href="https://soundcloud.com/grixis/peacetreaty-change-grixis">
</audio>
ive also tried the following below:
<audio controls autoplay loop>
<source src="https://soundcloud.com/grixis/peacetreaty-change-grixis" type="audio/mp3">
</audio>
Failed to load resource: net::ERR_FILE_NOT_FOUND
You are providing a soundcloud link, which is a HTML page. Try providing a mp3 link instead.
If you need the ability to play from soundcloud, try embedding their player.
https://soundcloud.com/pages/embed

Play video in html5 from presigned amazon url

Is it possible to play video in html5 from presigned amazon url?
For example, here I have a presigned amazon url:
https://s3.us-east-1.amazonaws.com/zed-content/Activity%20Contents/test%20act%20Content/testVid47.MOV?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ7V4MJWO3GNAM6WA%2F20180829%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180829T082051Z&X-Amz-Expires=604800&X-Amz-Signature=7ec66a41cc4c536ccc4abd42e5fea3621438563b114f72dd26f71c14eb4c4edd&X-Amz-SignedHeaders=host
When I click it a video starts to download. But when I try to do this:
<video class="videoElement" data-aura-rendered-by="116:582;a">
<source src="https://s3.us-east-1.amazonaws.com/zed- content/Activity%20Contents/test%20act%20Content/testVid47.MOV?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJ7V4MJWO3GNAM6WA%2F20180829%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20180829T082051Z&X-Amz-Expires=604800&X-Amz-Signature=7ec66a41cc4c536ccc4abd42e5fea3621438563b114f72dd26f71c14eb4c4edd&X-Amz-SignedHeaders=host"
type="video/mp4"
id="videoSrc">
Your browser does not support the video tag.
</video>
I am getting just a blank space:
What am I doing wrong here? Why does not my video playing?

How to play google drive mp3 file using html audio tag?

My aim is to play the mp3 file from the google drive. I am using the plugin MediaElement js. The reference I got is https://www.portalzine.de/dev/html5/hosting-mp3-files-on-google-drive-html5-audio-player/
This is working in chrome, Mozilla firefox but not in IE-11, safari and opera. I want this to be play in all browsers. Please give me the suggestions....
1. URL for the audio file (anyone can view)
https://drive.google.com/file/d/1nQklEicsMeGBnuk0vv6zkHtXtyGy10S-/view?usp=sharing
2. Extract the id from URL
1nQklEicsMeGBnuk0vv6zkHtXtyGy10S-
3. URL for playing the audio file
https://docs.google.com/uc?export=download&id={id}
example:
https://docs.google.com/uc?export=download&id=1nQklEicsMeGBnuk0vv6zkHtXtyGy10S-
4. URL for downloading the audio file
https://drive.google.com/uc?authuser=0&id={id}&export=download
example:
https://drive.google.com/uc?authuser=0&id=1nQklEicsMeGBnuk0vv6zkHtXtyGy10S-&export=download
5. HTML for playing audio:
<audio controls="controls">
<source src="https://docs.google.com/uc?export=download&id={id}">
</audio>
example:
<audio controls="controls">
<source src="https://docs.google.com/uc?export=download&id=1nQklEicsMeGBnuk0vv6zkHtXtyGy10S-">
</audio>
6. HTML for downloading audio:
<a href="https://drive.google.com/uc?authuser=0&id={id}&export=download"/>Download
example:
<a href="https://drive.google.com/uc?authuser=0&id=1nQklEicsMeGBnuk0vv6zkHtXtyGyO9S-&export=download"/>Download
In another thread on another page someone wrote the only solution that has worked for me:
If you share an MP3 by link, you obtain a link like this
https://drive.google.com/file/d/XXXXXXXXXXXXXXXXXX/view?usp=sharing
where XXXXXXXXXXXXXXXXXX is the ID of your MP3 file. Then you can obtain a direct link to this audio by
http://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXX
In particular you can use
<audio controls>
<source src="http://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXX" type="audio/mp3">
<p>Your browser does not support HTML5 audio :(</p>
</audio>
The first link is the one you normally get, the other link is what you want to use with
Try to think of this as HTML code:
<audio controls>
<source src="http://docs.google.com/uc?export=open&id=XXXXXXXXXXXXXXXXXX" type="audio/mp3">
</audio>
Make sure you convert that link right and it will work!
I'm using Direct Link Creator plugin of Google Drive and get the link easily. Here's an example.
<audio controls="controls">
<source src="https://docs.google.com/uc?export=download&id=0B_ETxiqrp0SzbF9VQ3JCS2hnSlU">
</audio>
<video controls="controls">
<source src="https://drive.google.com/uc?export=download&id=0B0JMGMGgxp9WMEdWb1hyQUhlOWs" type='video/mp4' />
</video>
I was trying to accomplish this inside the SSML audio tag for Actions on Google. None of the above steps seemed to work. I finally found a solution.
1) Get the file ID from the sharing link
https://drive.google.com/file/d/your_file_id/view?usp=sharing
2) Construct the direct link
http://docs.google.com/uc?export=open&id=your_file_id
3) Paste the direct link into a web browser and hit enter
4) Copy the resulting URL after you have been redirected by your browser
Note: This will be a much longer URL that looks something like this:
https://doc-XX-XX-docs.googleusercontent.com/docs/securesc/XXXXXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXX/000000000000000/0000000000000000000000/*/your_file_id?e=open
Using this final URL is the only way I could get my uploaded sound files to work with Actions on Google.

HTML5 audio not streaming same file on multiple computers

I'm using the HTML5 audio tag to create a music player on my remote server. The audio tag works as expected when one computer is playing.
However, I'm getting a problem where if two computers are trying to play the same audio file, one of them will not stream until the other has paused its playing, finished streaming, or stopped streaming.
Is there some programming/server configuration that lets me stream the same file to multiple devices at the same time?
Here's the code, as requested
<html>
<body>
<audio id="jukebox" controls>
<source id="musiclocation" src="/music/test.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
</body>
</html>