I am using cordova 3 and building app for ios.
I'm streaming audio channel using html5 audio player. Now as it has no stop function, so I had to change the source of the player to an invalid stream address to stop player both streaming and loading.
Before this stop mechanism, when I use the pause functionality the player kept loading the stream. That unacceptable. Because I don't want the user to waste bandwidth when the player is in pause mode. So the idea worked of that invalid addres. But when I set the address the player shows
cannot play audio file
I want to show
please select a channel
Is there any way to replace this text as I want to?? I tried
document.getElementById('myaudio').text="Plese select a channel";
It's not working. Player still shows cannot play audio file
How to achive this functionality?
Related
I'm posting this in case others have a similar problem.
I have a web app that uses the <audio> element. When the user clicks a button, I set the src attribute on the <audio> element to a URL of a mp3 file, then I call .load() and then .play(). The play() method's Promise resolves properly.
On the web, this works, I hear the music. On Android Chrome, the audio did not play:
The Play/Pause control showed the Pause icon (indicating the audio element thinks it's playing).
The progress on the track stayed frozen at the beginning 0:00.
If I muted the element, the track started playing.
If I just browsed to the URL of the mp3 file in Chrome, the audio loaded and I could play the song.
Anybody out there know why?
After a bunch of playing around and debugging, on a whim I finally removed some code I had planned to experiment with around audio context / graph:
const audioCtx = new AudioContext();
const sourceNode = audioCtx.createMediaElementSource(this.audioElem);
After remove these lines - the <audio> element played properly!
I have a question on audio / video playing for mobile devices without user interaction (touch events)?
How to play the audio / video file without touch events? On googling I had found that
In ipad device browsers, Safari 4+ above versions are able to play the audio / video file with user interactions only. But I need to play the audio / video files without user interactions in latest versions.
Is it possible to play the video and audio file with single click operation?
For more details:
Example:
In device browsers (ios /android) we are loading a html page. Here, Html page loads the video files,audio files. User can play few user interactive operations on the html page. When user perform operations parallely audio files will played based on the selection of operation. To resolve the issue,let us know any approaches.
I need to check if a user has actually seen an embedded youtube video (meaning that he pressed play and saw until the end). Is it possible to do this with the youtube api (javascript)?
Thank you very much
Regards
Using the Youtube API is the most easiest way determining if the user clicked the play button.
For starters check out the Google Youtube Api:
https://developers.google.com/youtube/js_api_reference
You will be needing to use the Swfobject.js to load the video to use the Youtube API controls
on loading the video don't forget to add a listener (addListener)
when the API or the video was loaded you will able to see the state of the videos , here are those:
"-1" - video is ready to play
"1" - the video is playing (it clicked the play button)
"2" - the video is paused
"0" - end of the video
Sample coding on checking the current state of the loaded video:
https://developers.google.com/youtube/js_api_reference#SubscribingEvents
If it is a chromeless YouTube player or if you embedded the video via JW Player, then it is possible.
The chromeless player will strip out the coding and allow you to embed
the YouTube video like javascript, once done, then you can embed a
Google Analytics extension snippet/code to the address of the video
and track the hits that way. Another way is installing JW Player which
allows you to easily track analytics for YouTube videos by
incorporating your Google Analytics UPI.
I am very new in HTML5 player and need help. I am using the latest mediaelement.js file for the player. I am facing problem in certain cases. I have initialized the player and now want to do some work around :
Initially initialize the HTML5 mediaelement player and load all the controls but not pass the video src
Pass the video src once the live url coming wowza server is available as player.setSrc('url')
Change the video url onclick and the player to restart the video playing for the new src
How to define the provider and netconnectionurl in the player as we can define in flowplayer
Loading of player is not smooth in android tablet and also sometimes browser crashes on fullscreen
I tried to load the player initially without passing the video src but it does not load the controls only shows Download File. This is important for me as the live url comes after a delay from the server and i need to initailize the player before. Changing video url onclick seems to work for browser that supports HTML5 but in browser that uses flash fallback the video src does not change onclick. I have different channels and i want to load the channel url and play the video onclick. I don't want to pass the rtmp url with the stream url. I want to define it in the player from before and if possible change it dynamically. In android dont know why sometimes player does not load properly and browser crashes. Any help would be great.
Is there a way I can play a sound each time a click is made using ZeroClipboard?
I have a custom sound made that I want to play on those events.
PS. I can't use an <embed> here because I don't want the ugly "allow this page to play with quicktime" alerts that the browser will throw. Is there a way I can put in my sound in ZeroClipboard?
You have two options as i see it.
1. you can create a html5 audio player that plays a sound on the click event
2. you can create a flash file that houses a mp3 player. using flashvars you can send events to flash telling it to play the sound. the benefit of this is true cross browser compatibility (if your worried about this). this is essentially how the web experience of grooveshark and rdio operate. (mainly because of the html5 audio vulnerability)