@@ -491,7 +491,7 @@ audioPlayer.on('reset', () => { // Set the 'reset' event callback.
audioPlayer=undefined;
});
audioPlayer.on('timeUpdate',(seekDoneTime)=>{// Set the 'timeUpdate' event callback.
if(typeof(seekDoneTime)=="undefined"){
if(seekDoneTime==null){
console.info('audio seek fail');
return;
}
...
...
@@ -546,7 +546,7 @@ Subscribes to the 'timeUpdate' event.
```js
audioPlayer.on('timeUpdate',(seekDoneTime)=>{// Set the 'timeUpdate' event callback.
if(typeof(seekDoneTime)=='undefined'){
if(seekDoneTime==null){
console.info('audio seek fail');
return;
}
...
...
@@ -595,7 +595,6 @@ Enumerates the audio playback states. You can obtain the state through the **sta
| stopped | string | Audio playback is stopped. |
| error<sup>8+</sup> | string | Audio playback is in the error state. |
## VideoPlayer<sup>8+</sup>
Provides APIs to manage and play video. Before calling an API of **VideoPlayer**, you must call [createVideoPlayer()](#mediacreatevideoplayer8) to create a [VideoPlayer](#videoplayer8) instance.
...
...
@@ -635,7 +634,7 @@ Sets **SurfaceId**. This API uses a callback to return the result.
```js
videoPlayer.setDisplaySurface(surfaceId,(err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('setDisplaySurface success!');
}else{
console.info('setDisplaySurface fail!');
...
...
@@ -691,7 +690,7 @@ Prepares for video playback. This API uses a callback to return the result.
```js
videoPlayer.prepare((err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('prepare success!');
}else{
console.info('prepare fail!');
...
...
@@ -741,7 +740,7 @@ Starts to play video resources. This API uses a callback to return the result.
```js
videoPlayer.play((err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('play success!');
}else{
console.info('play fail!');
...
...
@@ -791,7 +790,7 @@ Pauses video playback. This API uses a callback to return the result.
```js
videoPlayer.pause((err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('pause success!');
}else{
console.info('pause fail!');
...
...
@@ -841,7 +840,7 @@ Stops video playback. This API uses a callback to return the result.
```js
videoPlayer.stop((err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('stop success!');
}else{
console.info('stop fail!');
...
...
@@ -891,7 +890,7 @@ Switches the video resource to be played. This API uses a callback to return the
```js
videoPlayer.reset((err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('reset success!');
}else{
console.info('reset fail!');
...
...
@@ -942,7 +941,7 @@ Seeks to the specified playback position. The next key frame at the specified po
```js
videoPlayer.seek((seekTime,err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('seek success!');
}else{
console.info('seek fail!');
...
...
@@ -970,7 +969,7 @@ Seeks to the specified playback position. This API uses a callback to return the
```js
videoPlayer.seek((seekTime,seekMode,err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('seek success!');
}else{
console.info('seek fail!');
...
...
@@ -1034,7 +1033,7 @@ Sets the volume. This API uses a callback to return the result.
```js
videoPlayer.setVolume((vol,err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('setVolume success!');
}else{
console.info('setVolume fail!');
...
...
@@ -1090,7 +1089,7 @@ Releases the video playback resource. This API uses a callback to return the res
```js
videoPlayer.release((err)=>{
if(typeof(err)=='undefined'){
if(err==null){
console.info('release success!');
}else{
console.info('release fail!');
...
...
@@ -1148,7 +1147,7 @@ function printfDescription(obj) {