What is VideoView's equivalent of MediaPlayer.reset in Android - android-videoview

I have application with VideoView in a activity (not the main activity). Sometimes VideoView freezes when it reaches end of media. When it happens VideoView does not play other media when the same activity is started again, no sound, no video, just background color.
Is there a way to reinitialize the VideoView like it was never used, without restarting the application ? I believe MediaLayer.reset can do that, although I did not try it yet.
Regards, Martin
Update: now the issue seems to be related to loss of wifi signal.

Related

Digital Signage - After like 2 hours videos are slow

I have developed a system, in AS3 for Android, where one video after another plays, but after letting them run for an hour or two, the videos show between cut or slow. That happens when I run it on an android with device, but that does not happen on my PC. I have used the "dispose()" of the NetStream and set the NETSTREAM to NULL. Could someone tell me what's wrong? I've also set hardware acceleration to "DIRECT" and RENDER MODE to "AUTO". Oh, I also use System.gc();

WebXR and WebRTC don't work simultaneously

I am new to WebXR. I was trying to use webRTC with WebXR. The user will first enter into AR session and then create a WebRTC peer connection but ice candidates are not generated in Chrome for Android of the user is in AR session. As soon as the user gets out of AR session, ice candidates are transferred. Is this a bug in Chrome??
The problem is Hardware related. Some devices allow the use of both Front and back camera simultaneously. In such devices, the code worked properly. In other devices, both front and back camera cannot be accessed simultaneously. Hence, code does not work in these devices. Also, the WebXR Device API does not allow access to camera feed at the moment, however it is a proposed feature.
Although I haven't tried it myself. But you can in theory use the canvas captureStream API to stream webXR canvas.
Can you post your code here. You might want to tweak how you pass stream to the webrtc connection.
As far as I know, it is not possible to use canvas.captureStream() because WebXR doesn't render to the canvas directly.
I am also looking for a way to stream a webXR-Session via WebRTC. So I would be highly interested in your solution shivamag00!
Hope to hear from you!

Running LibGDX app

Sometimes, when I launch my game in LibGDX (the game doesn't require much power) the rendering is very laggy, but most of the time, when I run it the game runs smooth perfectly.
I would understand this if it would be laggy all the time, but it's laggy only in about 10% of the times when I run it. When I close it and run it again, it runs perfectly. Why is this happening?
I use Eclipse for launching and it runs as a desktop app.
I had the same problem. Try running it alone without Eclipse and it should work.
I experience this a lot it's not because of your libGdx project it's because of your computer. Computers just lag from time to time because of the multiple data or information they are handling everytime you're using it. Just ignore it man the important thing is you're making an awesome project, just don't mind the lag.
If you have a dual monitor setup, can you ensure there's no GPU activity on the other display? I noticed even with a decent setup, if something else was on my opposite monitor (eg., a chat client or a browser window) projects would run at a significantly slower framerate.

Wp8 SetAudioEndpoint messing with audio hardware clock?

I'm using WASAPI to capture and render audio for a VoIP application on Windows Phone 8. The app works fine when using the earpiece, but as soon as I switch to speakerphone, a distinct clicking noise appears on the far end. Looking into the timing of my system, I found that after I switched endpoints to speakerphone the mic hardware timer starts to act weird.
My audio loop starts with a WaitForMultipleObjectsEx which is woken up every 10ms by the mic capture event. After switching audio endpoints, I find this this event fires 101 times in 1 second, instead of 100. Every second, the last capture of 480 frames is split into 2 captures, whose timings add up to 10ms. This confuses me to no end, and is causing problems in my audio system.
Does anyone know what is going on, or can someone point me in the right direction?
MSFT is officially looking into a bug in WASAPI caused by multiple endpoint switches. It is confirmed on RT and being investigated for Wp8. Just an update.

In AS3 how can you detect if someone pulls their camera out of the USB port?

In AS3 if the SWF gets a hold of someone's camera successfully and they start streaming video across and everything, but then mid-stream, either they accidentally wiggle their camera out of the USB port, or the camera just sort of breaks down, or something else like that, how could you detect it from that user's side? I've tried using event listeners and also polling different variables every five seconds, but neither has worked; none of the public properties of Camera or its events seem to act funny at all when something like that happens. And apparently you can't just keep scanning the computer for devices (for good reason, I guess).
Is there something I'm missing here? Is there a way to detect from a user's copy of a SWF (FP or AIR, but much more importantly FP) when their camera has effectively stopped as the result of something going wrong, such as them wiggling it out of the computer by mistake? If so how? Thanks!
While you may have difficulty in detecting when the camera/microphone stops working or is deactivated, you can discern that something has gone wrong if you are publishing the video/audio to a server with a NetStream.
The NetStream has an info property which is a NetStreamInfo object. It will give you both a running total of bytes as well as a rate of bytes/second of data that the NetStream is sending to the server.
Running totals: byteCount, audioByteCount, videoByteCount
current rate in bytes/second: currentBytesPerSecond, audioBytesPerSecond, videoBytesPerSecond
If you use the running totals, you need to periodically check the byteCount and calculate your own rate. Or you can let Flash Player do all the work and use the rates that it's calculating. In the case of recording, these values give you an indication of how much data the NetStream is receiving from the camera/microphone (and going to send to the server).
We found that we could reliably determine on the client that something had gone wrong when the rate fell below 5 kilobits/second. We used the same threshold and similar calculations on an FMS server (w/custom server side Actionscript) as well.
I don't recall a proper "get camera status" call you can make on demand but you can try listening for the status event and hope there's one fired on disconnect.
If you haven't already done so, on you 5 second check try: if(myCameraObject == null) assuming var myCameraObject = Camera.GetCamera();
If you can't find a better solution, consider placing a "Detect camera" button behind the camera feed. If the camera disconnects then the user would see the button and could click it to reconnect.
You can check if the camera object is null as suggested by #ToddBFisher, check the Camera.names.length>0 or a few other properties of the camera instance (see the links below). But in each of them you'll want to check it at a regular interval.
Working with Cameras
Monitoring Camera Status