|
@@ -81,6 +81,19 @@ export default class JitsiLocalTrack extends JitsiTrack {
|
81
|
81
|
this._startStreamEffect(effect);
|
82
|
82
|
}
|
83
|
83
|
|
|
84
|
+ const displaySurface = videoType === VideoType.DESKTOP
|
|
85
|
+ ? track.getSettings().displaySurface
|
|
86
|
+ : null;
|
|
87
|
+
|
|
88
|
+ /**
|
|
89
|
+ * Track metadata.
|
|
90
|
+ */
|
|
91
|
+ this.metadata = {
|
|
92
|
+ timestamp: Date.now(),
|
|
93
|
+ ...displaySurface ? { displaySurface } : {}
|
|
94
|
+ };
|
|
95
|
+
|
|
96
|
+
|
84
|
97
|
/**
|
85
|
98
|
* The ID assigned by the RTC module on instance creation.
|
86
|
99
|
*
|
|
@@ -196,6 +209,15 @@ export default class JitsiLocalTrack extends JitsiTrack {
|
196
|
209
|
this._initNoDataFromSourceHandlers();
|
197
|
210
|
}
|
198
|
211
|
|
|
212
|
+ /**
|
|
213
|
+ * Get the duration of the track.
|
|
214
|
+ *
|
|
215
|
+ * @returns {Number} the duration of the track in seconds
|
|
216
|
+ */
|
|
217
|
+ getDuration() {
|
|
218
|
+ return (Date.now() / 1000) - (this.metadata.timestamp / 1000);
|
|
219
|
+ }
|
|
220
|
+
|
199
|
221
|
/**
|
200
|
222
|
* Returns if associated MediaStreamTrack is in the 'ended' state
|
201
|
223
|
*
|