Skip to content

Commit fafea5d

Browse files
committed
AG-15846 Add StreamFormat object to StreamRequest in google-ima3-dai redirect
Squashed commit of the following: commit 8c26d60 Merge: 474a5a9 b21e188 Author: Adam Wróblewski <adam@adguard.com> Date: Fri Apr 24 14:50:27 2026 +0200 Merge branch 'master' into fix/AG-15846-01 commit 474a5a9 Author: Adam Wróblewski <adam@adguard.com> Date: Thu Apr 23 21:17:47 2026 +0200 Add `StreamFormat` object to `StreamRequest` in `google-ima3-dai` redirect
1 parent b21e188 commit fafea5d

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,14 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
1010
<!-- TODO: change `@added unknown` tag due to the actual version -->
1111
<!-- during new scriptlets or redirects releasing -->
1212

13+
## [Unreleased]
14+
15+
### Fixed
16+
17+
- Added the missing `google.ima.dai.api.StreamRequest.StreamFormat` object to the `google-ima3-dai` redirect.
18+
19+
[Unreleased]: https://github.com/AdguardTeam/Scriptlets/compare/v2.4.2...HEAD
20+
1321
## [2.4.2] - 2026-04-24
1422

1523
### Added
@@ -1047,4 +1055,3 @@ The format is based on [Keep a Changelog], and this project adheres to [Semantic
10471055
[@adguard/agtree]: https://www.npmjs.com/package/@adguard/agtree
10481056

10491057
[Trusted Types API]: https://developer.mozilla.org/docs/Web/API/Trusted_Types_API
1050-

src/redirects/google-ima3-dai.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ type EventHandlerConstructor = {
142142
type StreamRequestConstructor = {
143143
new (streamRequest?: StreamRequestInput): StreamRequestInstance;
144144
prototype: StreamRequestInstance;
145+
StreamFormat: {
146+
DASH: 'dash';
147+
HLS: 'hls';
148+
};
145149
};
146150

147151
type LiveStreamRequestConstructor = {
@@ -437,6 +441,11 @@ export function GoogleIma3Dai(source: Source) {
437441
}
438442
};
439443

444+
const streamFormats = {
445+
DASH: 'dash',
446+
HLS: 'hls',
447+
} as const;
448+
440449
/**
441450
* Creates a base stream request instance.
442451
*
@@ -448,6 +457,7 @@ export function GoogleIma3Dai(source: Source) {
448457
) {
449458
initializeStreamRequest(this, streamRequest);
450459
} as unknown as StreamRequestConstructor;
460+
StreamRequest.StreamFormat = streamFormats;
451461

452462
/**
453463
* Creates a live stream request instance.

tests/redirects/google-ima3-dai.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,14 @@ test('Mocked - request classes and settings', (assert) => {
216216
);
217217
assert.strictEqual(uiSettings.getLocale(), 'en', 'UiSettings locale is stored');
218218
assert.deepEqual(daiSettings.getFeatureFlags(), { testFlag: true }, 'DaiSdkSettings stores feature flags');
219+
assert.deepEqual(
220+
api.StreamRequest.StreamFormat,
221+
{
222+
DASH: 'dash',
223+
HLS: 'hls',
224+
},
225+
'StreamRequest exposes the StreamFormat enum',
226+
);
219227
});
220228

221229
test('Mocked - invalid runtime inputs do not get copied into requests or stream data', (assert) => {

0 commit comments

Comments
 (0)