Skip to content

Commit

Permalink
添加音频和视频的格式 抛出
Browse files Browse the repository at this point in the history
  • Loading branch information
bosscheng committed Nov 29, 2023
1 parent 6078749 commit 4b15285
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 8 deletions.
4 changes: 4 additions & 0 deletions demo/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,8 @@ jessibuca.on('timeUpdate', function (ts) {

1. width:视频宽
2. height:视频高
3. encTypeCode 视频编码类型(10:h264,12:h265)
4. encType 视频编码类型(字符串)

```js

Expand All @@ -775,6 +777,8 @@ jessibuca.on("videoInfo", function (data) {

1. numOfChannels:声频通道
2. sampleRate 采样率
3. encTypeCode 音频编码类型(10:aac,7:ALAW(g711a),8:MULAW(g711u))
4. encType 音频编码类型(字符串)

```js

Expand Down
Binary file modified demo/public/dist.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/decoder.js

Large diffs are not rendered by default.

14 changes: 8 additions & 6 deletions dist/demo.html
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,14 @@
isNotMute: false,
},);

jessibuca.onLog = msg => console.error(msg);
jessibuca.onRecord = (status) => console.log('onRecord', status);
jessibuca.onPause = () => console.log('onPause');
jessibuca.onPlay = () => console.log('onPlay');
jessibuca.onFullscreen = msg => console.log('onFullscreen', msg);
jessibuca.onMute = msg => console.log('onMute', msg);
jessibuca.on('audioInfo', function (audioInfo) {
console.log('audioInfo',audioInfo);
})

jessibuca.on('videoInfo', function (videoInfo) {
console.log('videoInfo',videoInfo);
})

$player.style.display = 'inline-block';
$pause.style.display = 'none';
$destroy.style.display = 'none';
Expand Down
2 changes: 1 addition & 1 deletion dist/jessibuca.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/audio/audioContextLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export default class AudioContextLoader extends Emitter {
updateAudioInfo(data) {
if (data.encTypeCode) {
this.audioInfo.encType = AUDIO_ENC_TYPE[data.encTypeCode];
this.audioInfo.encTypeCode = data.encTypeCode;
}

if (data.channels) {
Expand Down
1 change: 1 addition & 0 deletions src/video/commonLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default class CommonLoader extends Emitter {
updateVideoInfo(data) {
if (data.encTypeCode) {
this.videoInfo.encType = VIDEO_ENC_TYPE[data.encTypeCode];
this.videoInfo.encTypeCode = data.encTypeCode;
}

if (data.width) {
Expand Down

1 comment on commit 4b15285

@vercel
Copy link

@vercel vercel bot commented on 4b15285 Nov 29, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.