Skip to content

Commit 160ee98

Browse files
committed
October 2022 Release of the APL 2022.2 compliant APL Viewhost Web
For more details on this release refer to CHANGELOG.md To learn about APL see: https://developer.amazon.com/docs/alexa-presentation-language/understand-apl.html
1 parent d875b5e commit 160ee98

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+2109
-2085
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog for apl-viewhost-web
22

3+
## [2022.2]
4+
This release adds support for version 2022.2 of the APL specification. Please also see APL Core Library for changes: [apl-core-library CHANGELOG](https://github.com/alexa/apl-core-library/blob/master/CHANGELOG.md)
5+
6+
### Added
7+
- Support continued command execution during APL document re-inflation
8+
9+
### Changed
10+
- Bug fixes
11+
312
## [2022.1.1]
413

514
### Changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Alexa Presentation Language (APL) Viewhost Web
22

33
<p>
4-
<a href="https://github.com/alexa/apl-viewhost-web/tree/v2022.1.1" alt="version">
5-
<img src="https://img.shields.io/badge/stable%20version-2022.1.1-brightgreen" /></a>
6-
<a href="https://github.com/alexa/apl-core-library/tree/v2022.1.1" alt="APLCore">
7-
<img src="https://img.shields.io/badge/apl%20core%20library-2022.1.1-navy" /></a>
4+
<a href="https://github.com/alexa/apl-viewhost-web/tree/v2022.2.0" alt="version">
5+
<img src="https://img.shields.io/badge/stable%20version-2022.2.0-brightgreen" /></a>
6+
<a href="https://github.com/alexa/apl-core-library/tree/v2022.2.0" alt="APLCore">
7+
<img src="https://img.shields.io/badge/apl%20core%20library-2022.2.0-navy" /></a>
88
</p>
99

1010
## Introduction

js/apl-html/lib/dts/Component.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,6 @@
3333
public ensureLayout() : Promise<void> | void;
3434
public isCharacterValid(c : string) : Promise<boolean>;
3535
public provenance() : string;
36+
public getMediaPlayer() : APL.MediaPlayer;
3637
}
3738
}

js/apl-html/lib/dts/Module.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
/// <reference path="./AudioPlayer.d.ts" />
6+
/// <reference path="./AudioPlayerFactory.d.ts" />
7+
/// <reference path="./MediaPlayer.d.ts" />
8+
/// <reference path="./MediaPlayerFactory.d.ts" />
59
/// <reference path="./Context.d.ts" />
610
/// <reference path="./Content.d.ts" />
711
/// <reference path="./Component.d.ts" />
@@ -87,6 +91,10 @@ declare namespace APL {
8791
public Metrics : typeof Metrics;
8892
public LiveMap : typeof LiveMap;
8993
public LiveArray : typeof LiveArray;
94+
public AudioPlayer : typeof AudioPlayer;
95+
public AudioPlayerFactory: typeof AudioPlayerFactory;
96+
public MediaPlayer: typeof MediaPlayer;
97+
public MediaPlayerFactory: typeof MediaPlayerFactory;
9098
}
9199
}
92100

js/apl-html/lib/dts/RootConfig.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,7 @@ declare namespace APL {
1616
public registerExtension(uri : string) : RootConfig;
1717
public liveMap(name : string, obj : any) : RootConfig;
1818
public liveArray(name : string, obj : any) : RootConfig;
19+
public audioPlayerFactory(factory: AudioPlayerFactory) : RootConfig;
20+
public mediaPlayerFactory(factory: MediaPlayerFactory) : RootConfig;
1921
}
2022
}

js/apl-html/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@
4444
"typedoc": "^0.15.0",
4545
"typescript": "2.7.2",
4646
"uglifyjs-webpack-plugin": "^2.1.2",
47-
"utf8-decode": "^1.0.2",
47+
"utf8": "3.0.0",
4848
"uuid": "^3.3.2",
4949
"webfontloader": "^1.6.28",
5050
"webpack": "^4.26.1",
51-
"webpack-bundle-analyzer": "^3.1.0",
52-
"webpack-cli": "^3.3.2",
51+
"webpack-bundle-analyzer": "^4.6.1",
52+
"webpack-cli": "^3.3.12",
5353
"webpack-merge": "^4.2.1",
5454
"xregexp": "4.2.4"
5555
}

js/apl-html/src/APLRenderer.ts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55

66
import throttle = require('lodash.throttle');
7-
import { AudioPlayerWrapper } from './AudioPlayerWrapper';
87
import { commandFactory } from './CommandFactory';
98
import { componentFactory } from './ComponentFactory';
109
import { ActionableComponent } from './components/ActionableComponent';
@@ -22,7 +21,7 @@ import { PointerType } from './enums/PointerType';
2221
import { IExtensionManager } from './extensions/IExtensionManager';
2322
import { ILogger } from './logging/ILogger';
2423
import { LoggerFactory } from './logging/LoggerFactory';
25-
import { AudioPlayerFactory } from './media/audio/AudioPlayer';
24+
import { AudioPlayerFactory, IAudioPlayerFactory } from './media/audio/AudioPlayerFactory';
2625
import { createAplVersionUtils } from './utils/AplVersionUtils';
2726
import { browserIsEdge } from './utils/BrowserUtils';
2827
import { ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, ARROW_UP, ENTER_KEY, HttpStatusCodes } from './utils/Constant';
@@ -210,7 +209,7 @@ export interface IAPLOptions {
210209
/** Device mode. If no provided "HUB" is used. */
211210
mode?: DeviceMode;
212211

213-
/** Optional externalized audio player */
212+
/** Optional externalized audio player factory */
214213
audioPlayerFactory?: AudioPlayerFactory;
215214

216215
/** Callback for executed SendEvent commands */
@@ -310,6 +309,12 @@ export default abstract class APLRenderer<Options = any> {
310309
*/
311310
protected abstract getDocumentAplVersion(): string;
312311

312+
/**
313+
* @internal
314+
* @ignore
315+
*/
316+
protected abstract getAudioPlayerFactory(): IAudioPlayerFactory;
317+
313318
/** A reference to the APL root context */
314319
public context: APL.Context;
315320

@@ -329,6 +334,7 @@ export default abstract class APLRenderer<Options = any> {
329334
this.handleConfigurationChange(configurationChangeOptions);
330335
}, 200);
331336

337+
/** Display state change handler */
332338
protected handleUpdateDisplayState: (displayState: DisplayState) => void;
333339

334340
/**
@@ -391,14 +397,16 @@ export default abstract class APLRenderer<Options = any> {
391397
*/
392398
private dropFrameCount: number = 0;
393399

400+
/**
401+
* @internal
402+
* @ignore
403+
*/
394404
private isEdge: boolean = browserIsEdge(window.navigator.userAgent);
395405

396406
public get options(): Options {
397407
return this.mOptions as any as Options;
398408
}
399409

400-
public audioPlayer: AudioPlayerWrapper;
401-
402410
/**
403411
* THis constructor is private
404412
* @param mOptions options passed in through `create`
@@ -500,8 +508,6 @@ export default abstract class APLRenderer<Options = any> {
500508
this.onResizingIgnored = mOptions.onResizingIgnored;
501509
}
502510

503-
this.audioPlayer = new AudioPlayerWrapper(mOptions.audioPlayerFactory);
504-
505511
this.maxTimeDeltaBetweenFrames = (1000 * this.TOLERANCE / this.MAXFPS);
506512
}
507513

@@ -775,7 +781,6 @@ export default abstract class APLRenderer<Options = any> {
775781
}
776782
(this.context as any) = undefined;
777783
}
778-
this.destroyAudioPlayer();
779784
this.removeRenderingComponents();
780785
if (this.view) {
781786
for (const eventName in this.viewEventListeners) {
@@ -974,6 +979,10 @@ export default abstract class APLRenderer<Options = any> {
974979
* @ignore
975980
*/
976981
private coreFrameUpdate(): void {
982+
if (this.getAudioPlayerFactory()) {
983+
this.getAudioPlayerFactory().tick();
984+
}
985+
977986
this.updateTime();
978987

979988
this.context.clearPending();
@@ -1303,11 +1312,4 @@ export default abstract class APLRenderer<Options = any> {
13031312
}
13041313
}
13051314
}
1306-
1307-
private destroyAudioPlayer(): void {
1308-
if (this.audioPlayer) {
1309-
this.audioPlayer.destroy();
1310-
this.audioPlayer = null;
1311-
}
1312-
}
13131315
}

js/apl-html/src/AudioPlayerWrapper.ts

Lines changed: 0 additions & 117 deletions
This file was deleted.

0 commit comments

Comments
 (0)