1# Multimedia Subsystem ChangeLog 2 3## cl.multimedia.audio.001 Call Mode Change of getRoutingManager() 4 5**getRoutingManager()** is changed from asynchronous to synchronous. 6 7**Change Impacts** 8 9If the new mode is not used, an error will be reported during compilation. 10 11**Key API/Component Changes** 12 13Before change: 14```js 15getRoutingManager(callback: AsyncCallback<AudioRoutingManager>): void; 16getRoutingManager(): Promise<AudioRoutingManager>; 17``` 18After change: 19```js 20getRoutingManager(): AudioRoutingManager; 21``` 22 23 24## cl.multimedia.audio.002 Call Mode Change of getStreamManager() 25 26**getStreamManager()** is changed from asynchronous to synchronous. 27 28**Change Impacts** 29 30If the new mode is not used, an error will be reported during compilation. 31 32**Key API/Component Changes** 33 34Before change: 35```js 36getStreamManager(callback: AsyncCallback<AudioStreamManager>): void; 37getStreamManager(): Promise<AudioStreamManager>; 38``` 39After change: 40```js 41getStreamManager(): AudioStreamManager; 42``` 43 44 45## cl.multimedia.audio.003 Registration Mode Change of micStateChange 46 47In the original **AudioRoutingManager**, the registration mode of the **micStateChange** listener of the **on()** function is changed. 48 49**Change Impacts** 50 51If the new mode is not used, an error will be reported during compilation. 52 53**Key API/Component Changes** 54 55Before change: 56 57```js 58interface AudioRoutingManager { 59 on(type: 'micStateChange', callback: Callback<MicStateChangeEvent>): void; 60} 61``` 62After change: 63```js 64interface AudioVolumeGroupManager { 65 on(type: 'micStateChange', callback: Callback<MicStateChangeEvent>): void; 66} 67``` 68 69 70## cl.multimedia.audio.004 Call Mode Change of getVolumeGroups() 71 72The call mode of **getVolumeGroups()** is changed. 73 74**Change Impacts** 75 76If the new mode is not used, an error will be reported during compilation. 77 78**Key API/Component Changes** 79 80Before change: 81```js 82getVolumeGroups(networkId: string, callback:AsyncCallback<VolumeGroupInfos>): void; 83getVolumeGroups(networkId: string): Promise<VolumeGroupInfos>; 84``` 85After change: 86```js 87getVolumeManager(): AudioVolumeManager; 88interface AudioVolumeManager{ 89 getVolumeGroupInfos(networkId: string, callback: AsyncCallback<VolumeGroupInfos>): void; 90 getVolumeGroupInfos(networkId: string): Promise<VolumeGroupInfos>; 91} 92``` 93 94 95## cl.multimedia.audio.005 Call Mode Change of getGroupManager() 96 97The call mode of **getGroupManager()** is changed. 98 99**Change Impacts** 100 101If the new mode is not used, an error will be reported during compilation. 102 103**Key API/Component Changes** 104 105Before change: 106```js 107getGroupManager(groupId: number, callback: AsyncCallback<AudioGroupManager>): void; 108getGroupManager(groupId: number): Promise<AudioGroupManager>; 109``` 110After change: 111```js 112getVolumeManager(): AudioVolumeManager; 113interface AudioVolumeManager{ 114 getVolumeGroupManager(groupId: number, callback: AsyncCallback<AudioVolumeGroupManager>): void; 115 getVolumeGroupManager(groupId: number): Promise<AudioVolumeGroupManager>; 116} 117``` 118 119 120## cl.multimedia.audio.006 FocusType Member Name Change 121 122**FOCUS_TYPE_RECORDING** of **FocusType** is renamed as **FOCUS_TYPE_DEFAULT**. 123 124**Change Impacts** 125 126If the new name is not used, an error will be reported during compilation. 127 128**Key API/Component Changes** 129 130Before change: 131```js 132enum FocusType { 133 FOCUS_TYPE_RECORDING = 0, 134} 135``` 136After change: 137```js 138enum InterruptRequestType { 139 INTERRUPT_REQUEST_TYPE_DEFAULT = 0, 140} 141``` 142 143 144## cl.multimedia.audio.007 Listener Registration Name Change of interrupt 145 146The listener registration name of **interrupt** of the **on()** function in **AudioRenderer** is changed. 147 148**Change Impacts** 149 150If the new name is not used, an error will be reported during compilation. 151 152**Key API/Component Changes** 153 154Before change: 155```js 156interface AudioRenderer { 157 on(type: 'interrupt', callback: Callback<InterruptEvent>): void; 158} 159``` 160After change: 161```js 162interface AudioRenderer { 163 on(type: 'audioInterrupt', callback: Callback<InterruptEvent>): void; 164} 165``` 166 167 168## cl.multimedia.media.001 Change of VideoRecorder APIs to System APIs 169 170In the MR version, the formal **AVRecorder** APIs (integrating audio and video) will be provided for external use. 171**VideoRecorder** APIs in API version 9 are changed to system APIs, which are available only to system users. In the future, **VideoRecorder** APIs will be deprecated after system users switch to **AVRecorder**. 172 173**Change Impacts** 174 175If the **VideoRecorder** caller is not a system user, the call will fail. 176 177Involved APIs and enumerations: 178 179function createVideoRecorder(callback: AsyncCallback<VideoRecorder>): void; 180 181function createVideoRecorder(): Promise<VideoRecorder>; 182 183type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; 184 185interface VideoRecorder{ 186 187 prepare(config: VideoRecorderConfig, callback: AsyncCallback<void>): void; 188 189 prepare(config: VideoRecorderConfig): Promise<void>; 190 191 getInputSurface(callback: AsyncCallback<string>): void; 192 193 getInputSurface(): Promise<string>; 194 195 start(callback: AsyncCallback<void>): void; 196 197 start(): Promise<void>; 198 199 pause(callback: AsyncCallback<void>): void; 200 201 pause(): Promise<void>; 202 203 resume(callback: AsyncCallback<void>): void; 204 205 resume(): Promise<void>; 206 207 stop(callback: AsyncCallback<void>): void; 208 209 stop(): Promise<void>; 210 211 release(callback: AsyncCallback<void>): void; 212 213 release(): Promise<void>; 214 215 reset(callback: AsyncCallback<void>): void; 216 217 reset(): Promise<void>; 218 219 on(type: 'error', callback: ErrorCallback): void; 220 221 readonly state: VideoRecordState; 222 223} 224 225interface VideoRecorderProfile { 226 227 readonly audioBitrate: number; 228 229 readonly audioChannels: number; 230 231 readonly audioCodec: CodecMimeType; 232 233 readonly audioSampleRate: number; 234 235 readonly fileFormat: ContainerFormatType; 236 237 readonly videoBitrate: number; 238 239 readonly videoCodec: CodecMimeType; 240 241 readonly videoFrameWidth: number; 242 243 readonly videoFrameHeight: number; 244 245 readonly videoFrameRate: number; 246 247} 248 249enum AudioSourceType { 250 251 AUDIO_SOURCE_TYPE_DEFAULT = 0, 252 253 AUDIO_SOURCE_TYPE_MIC = 1, 254 255} 256 257enum VideoSourceType { 258 259 VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, 260 261 VIDEO_SOURCE_TYPE_SURFACE_ES = 1, 262 263} 264 265enum VideoRecorderConfig { 266 267 audioSourceType?: AudioSourceType; 268 269 videoSourceType: VideoSourceType; 270 271 profile: VideoRecorderProfile; 272 273 url: string; 274 275 rotation?: number; 276 277 location?: Location; 278 279} 280 281## cl.multimedia.media.002 No Externally Provided Bit Rate Selection API in VideoPlayer 282 283In API version 9, **VideoPlayer** does not externally provide the bit rate selection API. Such an API will be provided by **AVPlayer** in the MR version. 284 285**Change Impacts** 286 287Bit rate selection cannot be performed in the multi-bit rate scenario of **VideoPlayer**. Relevant functions will be provided by **AVPlayer**. 288 289**Key API/Component Changes** 290 291Deleted APIs: 292 293interface VideoPlayer { 294 295 selectBitrate(bitrate: number): Promise<number>; 296 297 selectBitrate(bitrate: number, callback: AsyncCallback<number>): void; 298 299 on(type: 'availableBitratesCollect', callback: (bitrates: Array<number>) => void): void; 300 301} 302 303## cl.multimedia.media.003 Error Information Change of VideoRecorder 304 305Original error codes of **VideoRecorder** are changed because they do not comply with the error code specifications. 306 307**Change Impacts** 308 309Error codes returned from **VideoRecorder** are changed. 310 311**Key API/Component Changes** 312 313**VideoRecorder** APIs remain unchanged, but the returned error codes are changed. 314 315**Adaptation Guide** 316 317For details about exception handling, see the following documents: 318[Media](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/apis/js-apis-media.md) 319[Media Error Codes](https://gitee.com/openharmony/docs/blob/master/en/application-dev/reference/errorcodes/errorcode-media.md) 320