Skip to content

Commit

Permalink
Revert "Ensure that screen connection is made only on view request"
Browse files Browse the repository at this point in the history
This reverts commit b440283.
  • Loading branch information
aws-geoff committed Dec 6, 2019
1 parent b440283 commit 8c3ebf9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
16 changes: 9 additions & 7 deletions src/screenshareviewfacade/DefaultScreenShareViewFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,24 +45,26 @@ export default class DefaultScreenShareViewFacade implements ScreenShareViewFaca
);
}

async open(): Promise<void> {}

async close(): Promise<void> {}

async start(element: HTMLDivElement): Promise<void> {
async open(): Promise<void> {
const connectionRequest: ScreenViewingSessionConnectionRequest = new ScreenViewingSessionConnectionRequest(
this.configuration.urls.screenViewingURL,
this.configuration.urls.screenDataURL,
this.configuration.credentials.joinToken,
this.configuration.screenViewingTimeoutMs
);
await this.screenViewing.open(connectionRequest);
}

async close(): Promise<void> {
await this.screenViewing.close();
}

start(element: HTMLDivElement): void {
return this.screenViewing.start(element);
}

async stop(): Promise<void> {
stop(): void {
this.screenViewing.stop();
await this.screenViewing.close();
}

presentScaleToFit(): void {
Expand Down
8 changes: 2 additions & 6 deletions src/screenshareviewfacade/ScreenShareViewFacade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,24 @@ import ScreenObserver from '../screenviewing/observer/ScreenObserver';
export default interface ScreenShareViewFacade {
/**
* Opens the connections, must be called after the ScreenShareViewFacade is constructed
*
* @deprecated Use start when the user wants to start viewing screen
*/
open(): Promise<void>;

/**
* Closes screen viewing connection
*
* @deprecated Use stop when the user wants to stop viewing screen
*/
close(): Promise<void>;

/**
* Starts viewing the screen share within an HTML element. Note that an
* HTMLCanvas will be placed inside of this element.
*/
start(element: HTMLDivElement): Promise<void>;
start(element: HTMLDivElement): void;

/**
* Stops viewing the screen share.
*/
stop(): Promise<void>;
stop(): void;

/**
* Changes the presentation policy to scale-to-fit
Expand Down

0 comments on commit 8c3ebf9

Please sign in to comment.