openvidu/openvidu-browser/src/OpenViduInternal/Events/StreamPropertyChangedEvent.ts

77 lines
2.6 KiB
TypeScript
Raw Normal View History

2018-05-29 18:28:58 +02:00
/*
2020-02-04 11:25:54 +01:00
* (C) Copyright 2017-2020 OpenVidu (https://openvidu.io)
2018-05-29 18:28:58 +02:00
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
import { Event } from './Event';
import { Session } from '../../OpenVidu/Session';
import { Stream } from '../../OpenVidu/Stream';
import { StreamManager } from '../../OpenVidu/StreamManager';
2018-05-29 18:28:58 +02:00
/**
* Defines event `streamPropertyChanged` dispatched by [[Session]] as well as by [[StreamManager]] ([[Publisher]] and [[Subscriber]]).
* This event is fired when any remote stream (owned by a Subscriber) or local stream (owned by a Publisher) undergoes
* any change in any of its mutable properties (see [[changedProperty]]).
2018-05-29 18:28:58 +02:00
*/
export class StreamPropertyChangedEvent extends Event {
/**
* The Stream whose property has changed. You can always identify the user publishing the changed stream by consulting property [[Stream.connection]]
2018-05-29 18:28:58 +02:00
*/
stream: Stream;
/**
* The property of the stream that changed. This value is either `"videoActive"`, `"audioActive"`, `"videoDimensions"` or `"filter"`
2018-05-29 18:28:58 +02:00
*/
changedProperty: string;
/**
* Cause of the change on the stream's property:
* - For `videoActive`: `"publishVideo"`
* - For `audioActive`: `"publishAudio"`
* - For `videoDimensions`: `"deviceRotated"` or `"screenResized"`
* - For `filter`: `"applyFilter"`, `"execFilterMethod"` or `"removeFilter"`
*/
reason: string;
/**
* New value of the property (after change, current value)
2018-05-29 18:28:58 +02:00
*/
newValue: Object;
/**
* Previous value of the property (before change)
2018-05-29 18:28:58 +02:00
*/
oldValue: Object;
/**
* @hidden
*/
constructor(target: Session | StreamManager, stream: Stream, changedProperty: string, newValue: Object, oldValue: Object, reason: string) {
super(false, target, 'streamPropertyChanged');
2018-05-29 18:28:58 +02:00
this.stream = stream;
this.changedProperty = changedProperty;
this.newValue = newValue;
this.oldValue = oldValue;
this.reason = reason;
2018-05-29 18:28:58 +02:00
}
/**
* @hidden
*/
// tslint:disable-next-line:no-empty
callDefaultBehavior() { }
2018-05-29 18:28:58 +02:00
}