2018-05-29 18:28:58 +02:00
|
|
|
/*
|
2022-01-13 11:18:47 +01:00
|
|
|
* (C) Copyright 2017-2022 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';
|
2018-07-03 15:35:08 +02:00
|
|
|
import { StreamManager } from '../../OpenVidu/StreamManager';
|
2022-11-15 15:28:55 +01:00
|
|
|
import { StreamPropertyChangedEventReason, ChangedPropertyType } from './Types/Types';
|
2018-05-29 18:28:58 +02:00
|
|
|
|
|
|
|
/**
|
2022-01-13 13:54:34 +01:00
|
|
|
* Triggered by `streamPropertyChanged` (available for [Session](/en/stable/api/openvidu-browser/interfaces/SessionEventMap.html#streamPropertyChanged) and [StreamManager](/en/stable/api/openvidu-browser/interfaces/StreamManagerEventMap.html#streamPropertyChanged) objects)
|
2018-05-29 18:28:58 +02:00
|
|
|
*/
|
|
|
|
export class StreamPropertyChangedEvent extends Event {
|
|
|
|
/**
|
2018-07-03 15:35:08 +02:00
|
|
|
* 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;
|
|
|
|
|
|
|
|
/**
|
2022-11-02 12:11:01 +01:00
|
|
|
* The property of the stream that changed. This value is either `"videoActive"`, `"audioActive"`, `"videoTrack"`, `"audioTrack"`, `"videoDimensions"` or `"filter"`
|
2018-05-29 18:28:58 +02:00
|
|
|
*/
|
2022-11-15 15:28:55 +01:00
|
|
|
changedProperty: ChangedPropertyType;
|
2018-05-29 18:28:58 +02:00
|
|
|
|
|
|
|
/**
|
2018-07-03 15:35:08 +02:00
|
|
|
* Cause of the change on the stream's property:
|
|
|
|
* - For `videoActive`: `"publishVideo"`
|
|
|
|
* - For `audioActive`: `"publishAudio"`
|
2022-11-02 12:11:01 +01:00
|
|
|
* - For `videoTrack`: `"trackReplaced"`
|
|
|
|
* - For `audioTrack`: `"trackReplaced"`
|
2021-03-24 19:39:49 +01:00
|
|
|
* - For `videoDimensions`: `"deviceRotated"`, `"screenResized"` or `"trackReplaced"`
|
2019-09-19 15:33:37 +02:00
|
|
|
* - For `filter`: `"applyFilter"`, `"execFilterMethod"` or `"removeFilter"`
|
2018-07-03 15:35:08 +02:00
|
|
|
*/
|
2022-11-15 15:28:55 +01:00
|
|
|
reason: StreamPropertyChangedEventReason;
|
2018-07-03 15:35:08 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* New value of the property (after change, current value)
|
2018-05-29 18:28:58 +02:00
|
|
|
*/
|
|
|
|
newValue: Object;
|
|
|
|
|
|
|
|
/**
|
2018-07-03 15:35:08 +02:00
|
|
|
* Previous value of the property (before change)
|
2018-05-29 18:28:58 +02:00
|
|
|
*/
|
|
|
|
oldValue: Object;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
2022-08-17 18:04:05 +02:00
|
|
|
constructor(
|
|
|
|
target: Session | StreamManager,
|
|
|
|
stream: Stream,
|
2022-11-15 15:28:55 +01:00
|
|
|
changedProperty: ChangedPropertyType,
|
2022-08-17 18:04:05 +02:00
|
|
|
newValue: Object,
|
|
|
|
oldValue: Object,
|
2022-11-15 15:28:55 +01:00
|
|
|
reason: StreamPropertyChangedEventReason
|
2022-08-17 18:04:05 +02:00
|
|
|
) {
|
2018-07-03 15:35:08 +02:00
|
|
|
super(false, target, 'streamPropertyChanged');
|
2018-05-29 18:28:58 +02:00
|
|
|
this.stream = stream;
|
|
|
|
this.changedProperty = changedProperty;
|
|
|
|
this.newValue = newValue;
|
|
|
|
this.oldValue = oldValue;
|
2018-07-03 15:35:08 +02:00
|
|
|
this.reason = reason;
|
2018-05-29 18:28:58 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @hidden
|
|
|
|
*/
|
|
|
|
// tslint:disable-next-line:no-empty
|
2022-11-15 15:28:55 +01:00
|
|
|
callDefaultBehavior() { }
|
2022-08-17 18:04:05 +02:00
|
|
|
}
|