Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Release notes follow the [keep a changelog](https://keepachangelog.com/en/1.0.0/

### Added

- Added `ARCHITECTURE.md` with mermaid sequence diagram documenting the full media permission flow.
- Added `AirConsole.getConfiguration()` to expose the platform capability configuration from the `ready` event on screens.

## [1.10.0] - 2026-02-17

Expand Down
18 changes: 18 additions & 0 deletions airconsole-1.10.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,23 @@ AirConsole.prototype.arePlayersSilenced = function () {
&& (this.devices[AirConsole.SCREEN]["players"] !== undefined && this.devices[AirConsole.SCREEN]["players"].length > 0);
}

/**
* Returns the platform capability configuration delivered in the ready event.
* Use this to branch on device capabilities instead of platform or partner
* names. Only available on the screen; controllers receive undefined.
* Can only be called after onReady.
* @return {Object|undefined} An object with:
* supportedVideoFormats {string[]} - e.g. ["vp9","h264","vp8"]
* transparentVideoSupported {boolean}
* unityVideoSupported {boolean}
* graphicsQualityTier {string} - "low", "medium", or "high"
* Returns undefined on controllers or if the platform did not send it.
* @since 1.10.0
*/
AirConsole.prototype.getConfiguration = function() {
return this.configuration;
}

/**
* Dictionary of silenced update messages queued during a running game session.
* @private
Expand Down Expand Up @@ -1365,6 +1382,7 @@ AirConsole.prototype.onPostMessage_ = function(event) {
}

me.gameSafeArea = data.gameSafeArea;
me.configuration = data.configuration;
if (data.translations) {
me.translations = data.translations;
var elements = document.querySelectorAll("[data-translation]");
Expand Down
18 changes: 18 additions & 0 deletions beta/airconsole-1.11.0.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,23 @@ AirConsole.prototype.arePlayersSilenced = function () {
&& (this.devices[AirConsole.SCREEN]["players"] !== undefined && this.devices[AirConsole.SCREEN]["players"].length > 0);
}

/**
* Returns the platform capability configuration delivered in the ready event.
* Use this to branch on device capabilities instead of platform or partner
* names. Only available on the screen; controllers receive undefined.
* Can only be called after onReady.
* @return {Object|undefined} An object with:
* supportedVideoFormats {string[]} - e.g. ["vp9","h264","vp8"]
* transparentVideoSupported {boolean}
* unityVideoSupported {boolean}
* graphicsQualityTier {string} - "low", "medium", or "high"
* Returns undefined on controllers or if the platform did not send it.
* @since 1.10.0
*/
AirConsole.prototype.getConfiguration = function() {
return this.configuration;
}

/**
* Dictionary of silenced update messages queued during a running game session.
* @private
Expand Down Expand Up @@ -1585,6 +1602,7 @@ AirConsole.prototype.onPostMessage_ = function(event) {
}

me.gameSafeArea = data.gameSafeArea;
me.configuration = data.configuration;
if (data.translations) {
me.translations = data.translations;
var elements = document.querySelectorAll("[data-translation]");
Expand Down
5 changes: 3 additions & 2 deletions tests/airconsole-1.10.0-spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@
<script src="spec/methods/spec-persistent-data.js"></script>
<script src="spec/methods/spec-pause.js"></script>
<script src="spec/methods/spec-immersive.js"></script>
<script src="spec/methods/spec-player-silencing.js"></script>
<script src="spec/methods/spec-player-silencing.js"></script>
<script src="spec/methods/spec-configuration.js"></script>

<!-- include spec files here... -->
<!-- include spec files here... -->
<script src="spec/airconsole-1.10.0-spec.js"></script>

</head>
Expand Down
5 changes: 3 additions & 2 deletions tests/airconsole-1.11.0-spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@
<script src="spec/methods/spec-pause.js"></script>
<script src="spec/methods/spec-immersive.js"></script>
<script src="spec/methods/spec-player-silencing.js"></script>
<script src="spec/methods/spec-usermedia-permissions.js"></script>
<script src="spec/methods/spec-usermedia-permissions.js"></script>
<script src="spec/methods/spec-configuration.js"></script>

<!-- include spec files here... -->
<!-- include spec files here... -->
<script src="spec/airconsole-1.11.0-spec.js"></script>

</head>
Expand Down
17 changes: 17 additions & 0 deletions tests/spec/airconsole-1.10.0-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,4 +384,21 @@ describe("AirConsole 1.10.0", function () {

testAirConsole110Plus();
});

/**
======================================================================================
TEST CONFIGURATION FUNCTIONALITY
*/

describe("Configuration", function () {
beforeEach(function () {
initAirConsole();
});

afterEach(function () {
tearDown();
});

testGetConfiguration();
});
});
17 changes: 17 additions & 0 deletions tests/spec/airconsole-1.11.0-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -397,4 +397,21 @@ describe("AirConsole 1.11.0", function () {

testUserMediaPermissions();
});

/**
======================================================================================
TEST CONFIGURATION FUNCTIONALITY
*/

describe("Configuration", function () {
beforeEach(function () {
initAirConsole();
});

afterEach(function () {
tearDown();
});

testGetConfiguration();
});
});
36 changes: 36 additions & 0 deletions tests/spec/methods/spec-configuration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
function testGetConfiguration() {

it ("Should store configuration from ready event", function() {
var configuration = {
supportedVideoFormats: ["vp9", "h264", "vp8"],
transparentVideoSupported: true,
unityVideoSupported: true,
graphicsQualityTier: "high"
};
dispatchCustomMessageEvent({
action: "ready",
code: 1237,
device_id: 0,
devices: [{}, undefined, airconsole.devices[DEVICE_ID]],
configuration: configuration
});
expect(airconsole.getConfiguration()).toEqual(configuration);
});

it ("Should return undefined configuration when not provided in ready event", function() {
dispatchCustomMessageEvent({
action: "ready",
code: 1237,
device_id: 0,
devices: [{}, undefined, airconsole.devices[DEVICE_ID]]
});
expect(airconsole.getConfiguration()).toBeUndefined();
});

it ("Should return undefined configuration before onReady fires", function() {
// getConfiguration() must return undefined until the READY message has been processed;
// a freshly-constructed AirConsole instance has not yet received a ready event.
expect(airconsole.getConfiguration()).toBeUndefined();
});

}