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 Impact** 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 Impact** 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 Impact** 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 Impact** 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 Impact** 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 Impact** 125 126If the new mode 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 Impact** 149 150If the new mode 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 Impact** 174 175If the **VideoRecorder** caller is not a system user, the call will fail. 176Involved APIs and enums: 177function createVideoRecorder(callback: AsyncCallback<VideoRecorder>): void; 178function createVideoRecorder(): Promise<VideoRecorder>; 179type VideoRecordState = 'idle' | 'prepared' | 'playing' | 'paused' | 'stopped' | 'error'; 180interface VideoRecorder{ 181 prepare(config: VideoRecorderConfig, callback: AsyncCallback<void>): void; 182 prepare(config: VideoRecorderConfig): Promise<void>; 183 getInputSurface(callback: AsyncCallback<string>): void; 184 getInputSurface(): Promise<string>; 185 start(callback: AsyncCallback<void>): void; 186 start(): Promise<void>; 187 pause(callback: AsyncCallback<void>): void; 188 pause(): Promise<void>; 189 resume(callback: AsyncCallback<void>): void; 190 resume(): Promise<void>; 191 stop(callback: AsyncCallback<void>): void; 192 stop(): Promise<void>; 193 release(callback: AsyncCallback<void>): void; 194 release(): Promise<void>; 195 reset(callback: AsyncCallback<void>): void; 196 reset(): Promise<void>; 197 on(type: 'error', callback: ErrorCallback): void; 198 readonly state: VideoRecordState; 199} 200interface VideoRecorderProfile { 201 readonly audioBitrate: number; 202 readonly audioChannels: number; 203 readonly audioCodec: CodecMimeType; 204 readonly audioSampleRate: number; 205 readonly fileFormat: ContainerFormatType; 206 readonly videoBitrate: number; 207 readonly videoCodec: CodecMimeType; 208 readonly videoFrameWidth: number; 209 readonly videoFrameHeight: number; 210 readonly videoFrameRate: number; 211} 212enum AudioSourceType { 213 AUDIO_SOURCE_TYPE_DEFAULT = 0, 214 AUDIO_SOURCE_TYPE_MIC = 1, 215} 216enum VideoSourceType { 217 VIDEO_SOURCE_TYPE_SURFACE_YUV = 0, 218 VIDEO_SOURCE_TYPE_SURFACE_ES = 1, 219} 220enum VideoRecorderConfig { 221 audioSourceType?: AudioSourceType; 222 videoSourceType: VideoSourceType; 223 profile: VideoRecorderProfile; 224 url: string; 225 rotation?: number; 226 location?: Location; 227} 228 229## cl.multimedia.media.002 No Externally Provided Bit Rate Selection API in VideoPlayer 230 231In 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. 232 233**Change Impact** 234 235Bit rate selection cannot be performed in the multi-bit rate scenario of **VideoPlayer**. Relevant functions will be provided by **AVPlayer**. 236 237**Key API/Component Changes** 238 239Deleted APIs: 240interface VideoPlayer { 241 selectBitrate(bitrate: number): Promise<number>; 242 selectBitrate(bitrate: number, callback: AsyncCallback<number>): void; 243 on(type: 'availableBitratesCollect', callback: (bitrates: Array<number>) => void): void; 244} 245 246## cl.multimedia.media.003 Error Information Change of VideoRecorder 247 248Original error codes of **VideoRecorder** are changed because they do not comply with the error code specifications. 249 250**Change Impact** 251 252Error codes returned from **VideoRecorder** are changed. 253 254**Key API/Component Changes** 255 256**VideoRecorder** APIs remain unchanged, but the returned error codes are changed. 257 258**Adaptation Guide** 259 260For details about exception handling, see the following documents: 261https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/apis/js-apis-media.md 262https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/reference/errorcodes/errorcode-media.md 263