Skip to content

Commit

Permalink
docs: 优化 demo
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaohappy committed Feb 13, 2025
1 parent 9a39ae4 commit 2ed64c8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions publish.readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
目前 src 目录下子目录中的 package.json 仅用于发布 npm 包,根目录中的 package.json 和 webpack.config.js 用于编译和测试。下面是现在发布npm包的步骤,如果需要发布到你的私有npm仓库,可以参考:
目前 src 目录下子目录中的 package.json 仅用于发布 npm 包,根目录中的 package.json 和 webpack.config.js 用于编译和测试。下面是现在发布 npm 包的步骤,如果需要发布到你的私有 npm 仓库,可以参考:

1. 执行```node scripts/update-version.js --feature```更新所有子目录中 package.json 的版本,提交更改,并使用 git 标记相同的版本
1. 执行```node scripts/update-version.js --feature```更新所有子目录中 package.json 的版本,提交更改,并使用 git tag 打上相同的版本号

2. 执行```node scripts/build-package.js --package=all```编译所有包,此步骤会在各子目录的 dist 目录中生成要发布的文件。

Expand Down
6 changes: 3 additions & 3 deletions site/docs/demo/demux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import React from 'react'
let file: File
let stop = true

async function demuxFile(set: (v: string) => void) {
async function demuxFile(log: (v: string) => void) {

if (!stop) {
return
Expand All @@ -38,7 +38,7 @@ async function demuxFile(set: (v: string) => void) {
if (ret !== 0) {
break
}
set(`packet pos: ${avpacket.pos}, index: ${avpacket.streamIndex}, dts: ${avpacket.dts}, pts: ${avpacket.pts}, duration: ${avpacket.duration}, size: ${avpacket.size}, keyframe: ${avpacket.flags & AVPacketFlags.AV_PKT_FLAG_KEY}\n`)
log(`packet pos: ${avpacket.pos}, index: ${avpacket.streamIndex}, dts: ${avpacket.dts}, pts: ${avpacket.pts}, duration: ${avpacket.duration}, size: ${avpacket.size}, keyframe: ${avpacket.flags & AVPacketFlags.AV_PKT_FLAG_KEY}\n`)

if (stop) {
break
Expand All @@ -48,7 +48,7 @@ async function demuxFile(set: (v: string) => void) {
}
iformatContext.destroy()
destroyAVPacket(avpacket)
set('demux end\n')
log('demux end\n')
stop = true
}

Expand Down
6 changes: 3 additions & 3 deletions site/docs/demo/mux.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import React from 'react'
let file: File
let stop = true

async function muxFile(set: (v: string) => void) {
async function muxFile(log: (v: string) => void) {

if (!stop) {
return
Expand All @@ -31,7 +31,7 @@ async function muxFile(set: (v: string) => void) {
oformatContext.oformat = new OMovFormat()

ioWriter.onFlush = (buffer, pos) => {
set(`got output data size: ${buffer.length}\n`)
log(`got output data size: ${buffer.length}\n`)
return 0
}
ioWriter.onSeek = (pos) => {
Expand Down Expand Up @@ -73,7 +73,7 @@ async function muxFile(set: (v: string) => void) {
oformatContext.destroy()
destroyAVPacket(avpacket)

set('mux end\n')
log('mux end\n')
stop = true
}

Expand Down
4 changes: 2 additions & 2 deletions site/docs/demo/probe.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import React from 'react'

let file: File

async function probe(set: (v: string) => void) {
async function probe(log: (v: string) => void) {

const iformatContext = createAVIFormatContext()

Expand All @@ -30,7 +30,7 @@ async function probe(set: (v: string) => void) {
})
await demux.analyzeStreams(iformatContext)

set(dump([iformatContext], [{
log(dump([iformatContext], [{
from: file ? file.name : formatUrl('video/test.mp4'),
tag: 'Input'
}]))
Expand Down

0 comments on commit 2ed64c8

Please sign in to comment.