I have an Array of ArrayBuffers that I send through WebRTC from peerA to peerB. The major inconvenience that I'm experiencing is this: if peerA changes the tab to another one, then he is sending at a horribly slow rate. When peerA comes back to the app's tab, the sending speed hops back to normal levels.
Is there any way to address this particular problem?
I had a similar issue when I was slicing the files, that a change of tabs dropped the rate, and overcame this by using WebWorkers. As long as I have searched the WebRTC methods are not accessible from WebWorkers (just many people asking for this feature).
Any ideas?
There's a demo page at https://webrtc.github.io/samples/src/content/datachannel/datatransfer/ that will generate and transfer data. I'm unable to see any issue like the one you describe when I put the tab in the background. If this problem persists, please file a bug at https://bugs.webrtc.org.
I believe this may be a problem with the system timer resolution. Chrome sets this to 1 ms for certain active tabs, and sets it back to a higher value for backgrounded tabs to preserve battery life. To test this, try switching to a tab that is playing a YouTube video, and see if the send speed drops in the meantime.
Related
I have been working on a hobby browser game project. I use Express and Socket.io to add real-time feature to the game. My game is currently working 60FPS, it updates player's browser window every 16.67 milliseconds. Each frame, client's current position and it's pressed keys data sent to server via socket.io and each frame client receives other users' positions and pressed keys etc. I think that's pretty much of work for free service on Heroku.
You can check my project and problem using this link: https://test-game9.herokuapp.com/
Problem: Currently clients are able to move around using W, A, S, D keys. And they can see other user's movements. Nothing else. But for some reason my game deployed on Heroku flickers. This flickering problem doesn't occur on localhost. I wonder what's the problem. Do I miss some kind of socket.io options?
Thanks in advance.
It's hard to say what is wrong with this game without reviewing the code. However my guess is that you are not considering the network latency that's why your game works in localhost but not when deployed.
When I move using WASD, my object instantly moves. Which indicates that you are directly taking player's action into effect and update object's position then send the position to others. However the preferred alternative is that when player press any movement key, The information about the movement must be sent to the server first then broadcast it to everyone including moved player itself. Even though it's the player's object, player must listen for network to change position instead of doing it locally and instantly like single player games.
Another possible problem is that you are probably using an interval to send player's object position every N milliseconds whether anyone moved or not, This might be another cause of flicker. Instead you can just send position only when someone moves.
I want to record and play the video. I have found the below article to capture the same. but the recorded video is playing so fast and not playing all of the actions. after 32 seconds, it gets reset to starting position.
http://html5-demos.appspot.com/static/getusermedia/record-user-webm.html
I have used the code from (http://www.html5rocks.com/en/tutorials/getusermedia/intro/#toc-history). I can share it if required.
Any clues to resolve this?
Thanks
Off the top of my head, a reason why the video plays back too fast may be the fact that you are using a resolution that is to high for the current API to handle when recording.
I've tested similar attempts to record video directly in browser and had the same issue with playbacks of recording made with high resolutions.
Maybe this link could help
https://www.webrtc-experiment.com/RecordRTC/
or for an extensive overview of the current state of webRTC you can read the following article:
http://hdfvr.com/html5-video-recording
Is there a way to enable or disable sending crash report depending on a particular criteria. For example if want to send the crash report only if the device is connected to wifi and not through cellular network
Or if we want to send the report at a later time triggered by a user click a button.
As of now there's no way to do this via a criteria. You can either turn on/off crashing on the Crashlytics website. As for your second question this is the only way for now: http://support.crashlytics.com/knowledgebase/articles/92530-can-i-toggle-whether-or-not-a-user-needs-to-give-p
I was talking a while back with one of the members of their team and they said they may look into turning off/on the ability to collect crashes with a check box or something. So we'll see if that happens in the future. :)
Edit: actually see if something like this suits your needs
How to disable Crashlytics while developing
I have a live tile working which updates how many users are online and how many lobbies are open within the app. This begins updating when my app loses its visibility (no point it updating the live tile whilst the app is running), but I want it to update when I first turn the computer on.
I have had a look around and mentions of making the app a lock screen app have popped up but that is all, no explanation how to do it.
Does anyone know how to do this and provide a nice little explanation or link of how to do so?
Many thanks,
Kevin
You should use push notifications for this kind of behaviour. This msdn link has more info:-
Using tile notifications
Choosing the right notification method to update your tile
There are several mechanisms which can be used to update a live tile:
Local API calls
One-time scheduled notifications, using local content
Push notifications, sent from a cloud server
Periodic notifications, which pull information from a cloud server at a fixed time interval
The choice of which mechanism to use largely depends on the content you want to show and how frequently that content should be updated. The majority of apps will probably use a local API call to update the tile when the app is launched or the state changes within the app. This makes sure that the tile is up-to-date when it launches and exits. The choice of using local, push, scheduled, or polling notifications, alone or in some combination, completely depends upon the app. For example, a game can use local API calls to update the tile when a new high score is reached by the player. At the same time, that same game app could use push notifications to send that same user new high scores achieved by their friends.
You're right with the assumption that you require a lock screen capability to be able to run background tasks without your app being started once. The main process would be to extract the part of your application that gets the data into a background task that is probably triggered by a timer and write some code to be on the lock screen.
When I first encountered that restriction I was kind of surprised, but in terms of battery performance this design decision makes sense: Only consume battery power if the data is absolutely worth it. If it's worth, it is also of interest having it on the lock screen.
On MSDN is a good overview about lock screen along with further reading links. It's much better than what I could type in here. Come back with problems related the implementation (which actually even better fits the purpose of SO). This blog might be useful, too.
I need my application to perform a background task every day, but it does not comply with Apple's specification for running in background.
It's none of these: audio, location, VOIP, news stand, external-accessory—, Bluetooth-central.
I'm planning to use local notifications, but the point is, that if the user doesn't open the app (and just leaves it in the background), I cannot plan new local notifications.
What should I do in this situation?
Make something else.
Seriously, if your app doesn’t at least technically fit one of those categories, you’re not going to be able to get it to do background work in a way that’ll get you approved for the App Store.
I’ve seen apps that added specific functionality in one of those categories, orthogonal to their actual purpose, to be allowed to run in the background; for instance, there’s a couple of weather apps out there that play a continuous audio file—one of the available sounds being a silent one—in order to be able to update the lock screen’s “now playing” image with live data. If you don’t mind your users being unable to listen to any other music, and have your app continuously active (which might cause additional battery drain), that could work. But if you’re trying to have your app invisibly do things in the background, without interfering with anything else, in a way that’ll get you into the App Store, you’re probably out of luck.
Four options:
Go for jailbreak
Try to get in the app store as one of those types of apps, making up a feature that uses one of those types.
(my favorite) Really rethink your system, is it really necessary to schedule background tasks? Can't the user wait a bit when he opens the app? That loading can be performed in background. And can't you offload some of the work to a webserver? Are you collecting data? You shoudln't without the user consent.
Let your user know that it's important for him (he's the one using it right?) that he opens the app once a day.
I think I covered all yohr options except the one already covered by Noah.