I'm experimenting with a simple app that plays an audio file when run (isLooping=true, autoplay=true). It works fine but after closing it and opening it again, the audio file resumes playing the exact same second where I left it the time before, instead of starting over, as it should.
I tried doing audiofile.Stop() before audiofile.Play() but it doesn't work.
I'm guessing that the app never really "closes"? I'm not saving any progress in my app, it just launches and plays a file. That's all it does for now.
Thanks in advance,
call BackgroundAudioPlayer.Instance.Close() in OnNavigatedFrom of your screen and Application_Closing events.
Related
looking for assistance from anyone who might have some insight into this. having a problem with the MediaRecorder API built into Chrome, specifically on macOS, a problem that does not appear at all on windows
i am needing to capture the desktop screen as well as the desktop audio, and currently i get the stream using:
navigator.mediaDevices.getDisplayMedia({
video: {
cursor: 'always',
width: 1280,
height: 720,
frameRate: {
ideal: 12,
max: 15
},
},
audio: true
})
this of course gives the prompt for the user to select a screen/application/tab
following that, i load that into a new MediaRecorder:
new MediaRecorder(screenCaptureStream, {mimeType: "video/webm"})
on windows this all works fine. as long as the "Share Audio" checkbox on the bottom left is marked, audio will be heard in the ending file.
on mac however, the only time a "Share Audio" option is allowed is when a chrome tab is selected. this is fine for something like a youtube tab playing music, it captures both video and audio without a problem.
however, on a tab running an opentok video session, no audio coming from the video session is captured. at first i thought it may have been ffmpeg incorrectly processing it, but simply playing back the raw webm file gives no audio. checking with mediaInfo the file does indeed come back with an audio stream at "48.0kHz, 32bits, 1 channel, Opus"
because this isnt a problem on windows, i imagine that the Opentok video session is somehow outputting in such a way that it it bypassing the chrome tab altogether, so that even is the user can hear the audio, the recorder doesnt capture it.
does anyone know how to allow chrome to record audio on the Application/Screen choices on macOS?
EDIT: upon more experimentation, ive discovered that the issue lies in tokbox streams themselves.
setup: using a second pc, i hooked up my phone to a line-in port to use as the "mic" for the tokbox stream, and started up the session again. on that same page i have a youtube embedded iframe link to a random video, and on firefox, another video entirely.
selecting entire screen and making sure "Share Audio" is selected, i check that i can hear the audio being played from the phone on the other pc and its fine. the recording is going, and the checks for if there is an audio track pass. i swap to the next audio source by muting the 'phone' stream, and start playing the youtube embed. after a little bit, i stop it, and play the firefox video.
the results are that the embed and firefox audio got captured, but NONE of the tokbox audio got captured. (this was done on windows, so now i know its not a mac issue)
where is it being outputted?
I'm using JW Player to live stream content onto a web page. The player is backed by an open-source library called cine.io.
My issue is that the player falls back to an HTML 5 video element for all mobile web, both on iPhone and Android. There are some differences between the flash solution of JW Player and HTML5 - notably that if a live stream starts, then stops, then restarts, the video element will not pick up the restarted stream.
This is a problem since streams often drop in and out - and the flash solution does pick up the restarted stream.
I tested a bunch of listener methods on the video and the only one that signalled that the stream had ended was a "time update" listener:
$video.on('timeupdate', function(){
//Do something
});
However none of my attempts to re-open the stream have been effective.
Is this even possible? Can anyone provide pointers?
Would an example like this work?
http://support.jwplayer.com/customer/portal/articles/1442607-example-a-custom-error-message
I am currently using the HTML 5 audio tag in one of my projects. I load an MP3 file from an external source and then initiate it like that:
$("#audioPlayer").attr("src",audioStreamURL);
document.getElementById("audioPlayer").play()
This works fine, but I noticed that the Audio-Tag takes a long time to buffer before playing the file (Chrome and Safari), which causes a delay of a couple of seconds and thus reduces the user experience significantly.
Checking the console in Chrome, I noticed that the audio most times starts once ca. 5 MB have been "transferred".
I also checked if it is due to the server's latency and loaded the audio file in VLC-Player. However, here it started right away, with no delay at all.
Does anybody know, why Chrome does that? And even more important: Does anybody know a solution for that problem? A workaround or audio-tag alternative?
I would really appreciate your help!
Have a look at the "canplaythrough"-event of HTML5 Audio. This event fires when the Audio is able to play without buffering. You could bind a listener to that event, that will play the Audio.
Maybe this will be faster than just playing the Audio, which will wait for the complete file to be downloaded.
There I demonstrated how to preload an HTML5 Audio: preloading the next song in a playlist a bit before the current one ends
Very recently, after the latest Chrome update which includes Adobe Flash Player Version: 12.0.0.41, a flash app that's been running smoothly for years has begun to "hiccup" during one particular function.
Normal behavior - User logs in to app. App grabs some xml files then draws a calendar onscreen.
Hiccup behavior - User logs in to app. App grabs the xml files but feezes before executing the loadComplete function (according to trace). By freezes, I mean the little load spinner remains onscreen but stops spinning and the calendar doesn't appear onscreen.
Interesting/maddening notes - The mouse cursor responds as if the calendar has been drawn (arrow changes to pointer when mouse passes over an invisible calendar day) but according to my trace log the loadComplete and showCal functions haven't fired.
ALSO, any call to a function unfreezes the glitch (e.g. clicking an invisible calendar day, mousingOver a control button, etc. Anything that triggers a function.) and bam! everything's there and the trace log completes as it should.
As stated, this glitch only occurs in Chrome with the latest Flash Player update (12,0,0,41).
Installing the mozilla version of the flash player debugger (12,0,0,43) and instructing chrome to use it instead fixes the glitch, but using it in chrome opens up a whole new can of worms when it comes to flash player glitches (as is to be expected).
Maybe there's nothing I can do and it's just a fault with the latest Chrome flash player build, OR...
There's something fundamentally wrong with my code and Chrome's latest flash player is the only plugin that glitches on my "wrong" code?
I'll happily include some code snippets if someone is convinced my code is the problem but am leaving them off for now since this question is enormous. (you're a trooper for sticking with it)
I'm hoping someone else has experienced this or can at least explain it/fix it. Thanks in advance.
I'm seeing very similar symptoms on an application I work on Frankenscarf. All workarounds have been ineffective thus far. I can confirm it is specific to 12.0.0.41 Pepper Flash. I think you might need to wait for google to fix the lasted release...
I am also having problems with Flash 12.0.0.41 on YouTube, videos very laggy and dropping frames all the time even making the video stutter on 320p. I have disabled Chromes built in Flash player though Chrome://plugins, installed Chrome 11.7.700.260 and now have the videos running smoothly even at 1440p. Hopefully they will sort out the bugs soon.
I wasn't able to edit my original post...
UPDATE: I managed to get a workaround going. I set up a periodic timer (triggering every 500ms), that calls invalidateDisplayList() in my largest container. It is horrible, but it works....
This is a very strange bug! im using AS3 and CS5.
So i have a youtube video which plays on one frame, and on every other frame i have:
import flash.media.SoundMixer;
flash.media.SoundMixer.stopAll();
Which stops the video playing when you move to another page, this works fine when running it in flash, but when i publish it to a HTML file and upload it to my server it just never works! the sounds always play!
Is this to do with my publish settings or a strange flash bug?
Thanks,
Adam
When your SWF runs in the browser, it's subject to all the security restrictions that the browser imposes, as well as some additional Flash Player security restrictions. I imagine, that you're running into one of these restrictions.
Instead of trying to stop all sounds from playing, why don't you stop the Youtube player itself? It has an API you can use to do this, using either the pauseVideo() or stopVideo() methods.