Why can I change volume level on a webRTC call using the native control bar but not programatically? - volume

Reading this question looks like it's not possible to change volume levels to webRTC streams. Even exploring the audio stream object with dev tools, there is no volume property.
MediaStreamTrack {onended: null, onunmute: null, onmute: null, readyState: "live", enabled: true…}
enabled: true
id: "B3o0SZOXfI9PJjesCKxvFW0Gn3J6sYWxebvSa0"
kind: "audio"
label: "Default"
onended: null
onmute: null
onunmute: null
readyState: "live"
__proto__: MediaStreamTrack
Although the embedded controls of the video element, are able to change the volume levels (just to be sure, I checked and they are not changing the system level volume)
So how is it possible to change the volume levels using the controls but not programmatically?.
Does anybody know where these controls are pointing?.

It is possible to change the volume programmatically using jquery or javascript.
jquery was causing me confusion as I was trying to do
$("#videoid").volume
getting undefined as result, but the way to do it with jquery is
$("#videoid").prop("volume",0.5)
or with plain javascript
document.getElementById("videoid").volume=0.5;
With this we can change the volume during a live webrtc communication.

Related

inital state not visible in devtools

I have problem with ngrx simplest start up. Probably missing something
Isn' t it enough for devtools to display inital state list: [] ??
I have this
To view your store in the Redux-Devtools, you have to set up the StoreDevtoolsModule like described in the NgRx documentation
StoreDevtoolsModule.instrument({
maxAge: 25, // Retains last 25 states
logOnly: environment.production, // Restrict extension to log-only mode
autoPause: true, // Pauses recording actions and state changes when the extension window is not open
}),

Clear Flink watermark state in DataStream

Is it possible to clear the current watermark in a DataStream?
Example input for a month-long watermark with no allowed lateness:
[
{ timestamp: '10/2018' },
{ timestamp: '11/2018' },
{ timestamp: '11/2018', clearState: true },
{ timestamp: '9/2018' }
]
Normally, the '9/2018' record would be thrown out as it is late. Is there a way to programmatically reset the watermark state when the clearState message is seen?
Watermarks are not supposed to go backwards -- it's undefined what will happen, and in practice it's a bad idea. There are, however, various ways to accommodate late data.
If you are using the window API, Flink will clear any window state once the allowed lateness has expired for a window. If you want more control than this, consider using a ProcessFunction, which will allow/require you to manage state (and timers) explicitly.

A-Frame Daydream control?

Just started playing with A-Frame and I can see vive-controls and oculus-touch-controls but nothing for google daydream.
I've looked at the component repo and don't see anything that looks like it'll do the job. The closest thing to now investigate would be the Gamepad API, but I'm amazed I can't find anything.
I've got a Pixel XL & daydream and would like to incorporate the controller rather than just head tracking and gaze based control. Can someone point me in the right direction please.
Thanks
UPDATE - I've got the Daydream controller working for clicks! Running the 360-image-gallery(https://aframe.io/examples/showcase/360-image-gallery/) accepts clicks from the Daydream controller. I guess maybe it had timed out on my previous attempts or I hadn't paired it properly! I'll keep playing!
Working on setting up a Daydream remote in an Aframe project. There are no components for the daydream remote yet, but I'm hoping to complete one soon – and it sounds like they are gonna mainline support in an upcoming Aframe release.
But you can hand roll support no problem.
First, there are a few things you'll need to do in preparation:
Download Chrome Beta 56 on your Pixel:https://www.google.com/chrome/browser/beta.html
.
Open Chrome Beta, navigate to chrome://flags and enable the WebVR and Gamepad flags.
Now, you will be able to launch experiences that are built with Aframe v0.4 or higher in true WebVR. You'll get prompted with the usual Daydream screens (place your phone in the headset, and connect the remote.) If you are connecting to a local development environment, you'll see a secure connection warning but this, while annoying, won't stop you from working.
Second, now that you are running true WebVR, you need to leverage the Gamepad API to get information from your daydream remote. Lets start by just logging that it is connected.
window.addEventListener('gamepadconnected', function(evt) {
console.log("Gamepad connected at index %d: %s. %d buttons, %d axes.",
e.gamepad.index, e.gamepad.id,
e.gamepad.buttons.length, e.gamepad.axes.length);
});
Third, now that you are logging a connection, you will need to setup an update loop to get the current state of the Gamepad. You can do this with requestAnimationFrame. Follow the tutorial here: https://developer.mozilla.org/en-US/docs/Web/API/Gamepad_API/Using_the_Gamepad_API
Once I've published a basic dayframe-remote component, I'll post a link here. Hope this helps get you started!
EDIT: Looks like the suggestion below works great. Just pass "Daydream Controller" as the id for tracked controls: tracked-controls="id: Daydream Controller".
Here is a sample Daydream controller output. At the moment, only the trackpad button appears to be exposed – not the app or home buttons.
{
axes: [0, 1],
buttons: [{
pressed: false,
touched: false,
value: 0
}],
connected: true,
displayId: 16,
hand: "left",
id: "Daydream Controller",
index: 0,
mapping: "",
pose: {
angularAcceleration: null,
angularVelocity: [0, 0, 0],
hasOrientation: true,
hasPosition: false,
linearAcceleration: [0,0,0],
orientation: [0,0,0,1],
position: null
},
timestamp: 1234567890123
}
Something for you to try...
the way the current A-Frame 0.4.0 support in tracked-controls should work:
if you specify that it should only match an ID value of empty string '' then it should match any gamepad with a pose... so you can try something like
<a-entity tracked-controls="id:"></a-entity>
and see if that gets events etc.?
A-Frame master branch now contains a daydream controller component: https://aframe.io/docs/master/components/daydream-controls.html

RESTful advice: default value for given resource

I have the following rest structure for 'keyboard' objects:
GET /keyboards/ -> Lists user keyboards
POST /keyboards/ -> Creates new keyboard
GET /keyboards/{id} -> Get specific keyboard by id
PUT /keyboards/{id} -> Update specific keyboard by id
DELETE /keyboards/{id} -> Delete specific keyboard by id
The front end uses whatever keyboard is set to the users default keyboard, or, if the user has no custom keyboard set, simply returns a generic default.
At present, that is done by requesting another URL:
GET /keyboards/default
However, this appears a little misleading to me, as the resource 'default' could change whenever the user changes their default, and actually is a pointer to a different specific resource.
I'm not sure of a more elegant solution to this, as the front-end would appear to need to make two requests otherwise:
GET /keyboards/ -> Revealing the default
GET /keyboards/{id} -> To get the mappings associated with the keyboard
Which seems a more laborious, two step process. Is the first option a reasonable one, or am I missing a more elegant implementation?
It's OK to have convenience identifiers like 'default', 'latest' etc...
GET /keyboards/default
-> {
id: 3,
Another option is to hang the default keyboard off of a containing/referencing resource if there is one. For example
GET /computer
-> {
name: foo,
defaultKeyboard: 3,
...
If you want to avoid two requests you could have isDefault on the keyboard object.
GET /keyboards
[
{ id: 1, isDefault: false, ... }
{ id: 3, isDefault: true, ... }
That allows you to filter via querystring params.
Finally, this doesn't have to be an OR - you can have all of these for a convenient API for different access patterns.
Having to do a higher number of requests than with other architecture styles is a well-known and assumed drawback of RESTful APIs.
It is counterbalanced by the fact responses may be cached more easily as each resource has a unique URL.
Does you keyboard resource expose an "IsDefault" property? It should. And so:
GET /keyboards/
Would return a list of keyboards. You could examine the keyboard resources in the list and choose the one that is the default.
And you could also solve this by making this a query parameter:
GET /keyboards?IsDefault=true
There's nothing wrong with having a convenience /keyboards/default identifier, as long as its cacheability is being defined correctly, which in this case would probably be to tell clients to not cache it at all.

Loading extJS Combo Remotely not Working

This is my first bash at using extJS, and after a few hours of struggling, some things are working OK, except I have combo lists that I can't filter down to less than 2000 items in edge cases, so I'm trying to page the lists through remotely, but I must be doing something wrong.
My data store and combo look as follows:
var remoteStore = new Ext.data.JsonStore({
//autoLoad : true,
url : 'addition-lists.aspx',
fields : [{name: 'extension_id'}, {name: 'extension'}],
root : 'extensionList',
id : 'remoteStore'
});
.
.
xtype : 'combo',
fieldLabel : 'Remote',
name : 'remote',
displayField : 'extension',
valueField : 'extension_id',
mode : 'remote',
//pageSize : 20,
triggerAction : 'query',
typeAhead : true,
store : remoteStore,
anchor : '95%'
The combo works loading locally, but as soon as I switch to remote it remains blank.
My ASP.NET page returning the JSON is like this:
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.Write(GetRemote());
}
On remote stores the combo defaults its minChars property to 4, so the query only gets sent after typing 4 chars. Setting minChars almost gives the desired behaviour.
I say almost because even if the item sought by autocomplete is in the current page, a new server query still gets sent, defaulting the selection to the first item in the new page.
The way you configured your store above, the result from your ASP script should read something like this:
{"extensionList": [
{"extension_id": 1, "extension": "js"},
{"extension_id": 2, "extension": "aspx"}
]}
If it doesn't look like that, your remote store will not find anything.
You can refer to this question ExtJS combobox problem in IE
Several things. First, when doing this:
remoteStore.loadData(<%= GetRemote() %>);
you are not actually making a remote call from your javascript. You are echoing the result of calling the GetRemote server function directly into the page at render time. Probably not what you intend? If GetRemote is writing out your combo data (and it's working correctly), then you should be able to use a combo setup for local data. If the intention really is to make a remote call, then you need to remove the server tag and load data via the proxy url as shown in several examples that come with Ext.
Another thing is that your Page_Load code doesn't actually show anything about how you are loading, formatting or returning your data. I would suggest viewing source and verifying that your tag is actually being replaced with the data you expect. If/when you switch it to a true remote call to load data then you can use Firebug to inspect your XHR calls and verify the data coming down that way.
You must set a proxy, i.e. set
proxy: new ScriptTagProxy
property for loading 'store' remotely. Look at examples for exact syntax.
EDIT: Please disregard my previous note since you're using JsonStore shortcut.
Try to apply all of these properties to your combo:
typeAhead: true,
typeAheadDelay: 500,
triggerAction: 'all',
selectOnFocus:true,
And please do not do server-side prefetch of records (using loadData). It hurts internal filter very much, so that you stick with filtered records from different prefetches.
On the other hand, if you do prefetch all records on the server-side, why do you need then remote access for your combo anymore?!

Resources