|
@@ -10,7 +10,8 @@ export type AudioElement = {
|
10
|
10
|
currentTime?: number,
|
11
|
11
|
pause: () => void,
|
12
|
12
|
play: () => void,
|
13
|
|
- setSinkId?: string => void
|
|
13
|
+ setSinkId?: string => void,
|
|
14
|
+ stop: () => void
|
14
|
15
|
};
|
15
|
16
|
|
16
|
17
|
/**
|
|
@@ -61,8 +62,6 @@ export default class AbstractAudio extends Component<Props> {
|
61
|
62
|
this.setAudioElementImpl = this.setAudioElementImpl.bind(this);
|
62
|
63
|
}
|
63
|
64
|
|
64
|
|
- pause: () => void;
|
65
|
|
-
|
66
|
65
|
/**
|
67
|
66
|
* Attempts to pause the playback of the media.
|
68
|
67
|
*
|
|
@@ -73,10 +72,8 @@ export default class AbstractAudio extends Component<Props> {
|
73
|
72
|
this._audioElementImpl && this._audioElementImpl.pause();
|
74
|
73
|
}
|
75
|
74
|
|
76
|
|
- play: () => void;
|
77
|
|
-
|
78
|
75
|
/**
|
79
|
|
- * Attempts to being the playback of the media.
|
|
76
|
+ * Attempts to begin the playback of the media.
|
80
|
77
|
*
|
81
|
78
|
* @public
|
82
|
79
|
* @returns {void}
|
|
@@ -106,8 +103,6 @@ export default class AbstractAudio extends Component<Props> {
|
106
|
103
|
typeof setRef === 'function' && setRef(element ? this : null);
|
107
|
104
|
}
|
108
|
105
|
|
109
|
|
- setSinkId: string => void;
|
110
|
|
-
|
111
|
106
|
/**
|
112
|
107
|
* Sets the sink ID (output device ID) on the underlying audio element.
|
113
|
108
|
* NOTE: Currently, implemented only on Web.
|
|
@@ -120,4 +115,14 @@ export default class AbstractAudio extends Component<Props> {
|
120
|
115
|
&& typeof this._audioElementImpl.setSinkId === 'function'
|
121
|
116
|
&& this._audioElementImpl.setSinkId(sinkId);
|
122
|
117
|
}
|
|
118
|
+
|
|
119
|
+ /**
|
|
120
|
+ * Attempts to stop the playback of the media.
|
|
121
|
+ *
|
|
122
|
+ * @public
|
|
123
|
+ * @returns {void}
|
|
124
|
+ */
|
|
125
|
+ stop(): void {
|
|
126
|
+ this._audioElementImpl && this._audioElementImpl.stop();
|
|
127
|
+ }
|
123
|
128
|
}
|