Skip to content

Commit

Permalink
feat: support 4.3.0 (#1130)
Browse files Browse the repository at this point in the history
* feat: bump native sdk to 4.3.0

* feat: add IH265Transcoder

---------

Co-authored-by: sda-rob <[email protected]>
Co-authored-by: guoxianzhe <[email protected]>
  • Loading branch information
3 people authored Feb 28, 2024
1 parent e6a7777 commit 2ab7994
Show file tree
Hide file tree
Showing 91 changed files with 3,504 additions and 6,162 deletions.
1 change: 1 addition & 0 deletions .github/workflows/doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
generate-code: false
generate-comment: true
generate-comment-command: |
sh generate-prepare.sh
sh generate-comment.sh
- name: Create pull request
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/terra.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
generate-code: true
generate-comment: true
generate-code-command: |
sh generate-prepare.sh
sh generate-code.sh
generate-comment-command: |
sh generate-comment.sh
Expand Down
6 changes: 1 addition & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
### VisualStudioCode template
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.vscode
*.code-workspace

# Local History for Visual Studio Code
Expand Down
2 changes: 1 addition & 1 deletion .gitleaks.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
description = "file allow lists"
paths = [
'''gitleaks.toml''',
'''plugin-(.*?)-tool.cjs''',
'''plugin-(.*?)-tools.cjs''',
'''yarn-(.*?)(.cjs)''',
]

Expand Down
8 changes: 7 additions & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@
"hardenedRuntime": true,
"identity": null,
"target": [
"zip"
{
"target": "zip",
"arch": [
"x64",
"arm64"
]
}
],
"type": "distribution"
},
Expand Down
56 changes: 33 additions & 23 deletions example/src/renderer/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GithubOutlined, SettingOutlined } from '@ant-design/icons';
import { createAgoraRtcEngine } from 'agora-electron-sdk';
import { Layout, Menu } from 'antd';
import { ItemType } from 'antd/lib/menu/hooks/useItems';
import React, { Component } from 'react';
import {
Link,
Expand All @@ -20,7 +21,6 @@ import Hooks from './examples/hook';
const DATA = [Basic, Advanced, Hooks];

const { Content, Footer, Sider } = Layout;
const { SubMenu } = Menu;

class App extends Component {
state = {
Expand Down Expand Up @@ -48,28 +48,38 @@ class App extends Component {
}}
>
<div className="logo" />
<Menu theme="dark" defaultSelectedKeys={['1']} mode="inline">
<Menu.Item key="1" icon={<SettingOutlined />}>
<Link to="/">Setting</Link>
</Menu.Item>
{DATA.map((value, index) => {
return (
<SubMenu
key={`sub${index}`}
icon={<GithubOutlined />}
title={value.title}
>
{value.data.map(({ name }) => {
return (
<Menu.Item key={name}>
<Link to={`/${name}`}>{name}</Link>
</Menu.Item>
);
})}
</SubMenu>
);
})}
</Menu>
<Menu
theme="dark"
defaultSelectedKeys={['1']}
mode="inline"
//@ts-ignore
items={((): ItemType[] => {
let list = [
{
key: '1',
label: <Link to="/">Setting</Link>,
icon: <SettingOutlined />,
},
];
DATA.map((value, index) => {
let subMenu = {
key: `sub${index}`,
label: <>{value.title}</>,
icon: <GithubOutlined />,
children: [] as ItemType[],
};
value.data.map(({ name }) => {
subMenu.children.push({
key: name,
label: <Link to={`/${name}`}>{name}</Link>,
icon: <SettingOutlined />,
});
});
list.push(subMenu);
});
return list;
})()}
></Menu>
</Sider>
<Layout className="site-layout" style={{ marginLeft: 200 }}>
<Content>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
ChannelMediaRelayError,
ChannelMediaRelayEvent,
ChannelMediaRelayState,
ChannelProfileType,
ClientRoleType,
Expand Down Expand Up @@ -96,43 +95,16 @@ export default class ChannelMediaRelay
}

/**
* Step 3-1: startChannelMediaRelay
* Step 3: startOrUpdateChannelMediaRelay
*/
startChannelMediaRelay = () => {
startOrUpdateChannelMediaRelay = () => {
const { channelId, token, uid, destChannelNames } = this.state;
if (destChannelNames.length <= 0) {
this.error('destChannelNames is invalid');
return;
}

this.engine?.startChannelMediaRelay({
// Configure src info
// Set channel name defaults to current
// Set uid defaults to local
srcInfo: { channelName: channelId, uid, token },
// Configure dest infos
destInfos: destChannelNames.map((value) => {
return {
channelName: value,
uid: 0,
token: '',
};
}),
destCount: destChannelNames.length,
});
};

/**
* Step 3-2 (Optional): updateChannelMediaRelay
*/
updateChannelMediaRelay = () => {
const { channelId, token, uid, destChannelNames } = this.state;
if (destChannelNames.length <= 0) {
this.error('destChannelNames is invalid');
return;
}

this.engine?.updateChannelMediaRelay({
this.engine?.startOrUpdateChannelMediaRelay({
// Configure src info
// Set channel name defaults to current
// Set uid defaults to local
Expand Down Expand Up @@ -210,10 +182,6 @@ export default class ChannelMediaRelay
}
}

onChannelMediaRelayEvent(code: ChannelMediaRelayEvent) {
this.info('onChannelMediaRelayEvent', 'code', code);
}

protected renderConfiguration(): ReactElement | undefined {
const { destChannelNames } = this.state;
return (
Expand Down Expand Up @@ -246,13 +214,13 @@ export default class ChannelMediaRelay
onPress={
startChannelMediaRelay
? this.stopChannelMediaRelay
: this.startChannelMediaRelay
: this.startOrUpdateChannelMediaRelay
}
/>
<AgoraButton
disabled={!startChannelMediaRelay}
title={`updateChannelMediaRelay`}
onPress={this.updateChannelMediaRelay}
onPress={this.startOrUpdateChannelMediaRelay}
/>
<AgoraButton
disabled={!startChannelMediaRelay}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
ChannelProfileType,
ClientRoleType,
IRtcEngineEventHandler,
LocalVideoStreamError,
LocalVideoStreamReason,
LocalVideoStreamState,
MediaDeviceType,
RtcConnection,
Expand Down Expand Up @@ -304,7 +304,7 @@ export default class DeviceManager
onLocalVideoStateChanged(
source: VideoSourceType,
state: LocalVideoStreamState,
error: LocalVideoStreamError
error: LocalVideoStreamReason
) {
this.info(
'onLocalVideoStateChanged',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ChannelProfileType,
ClientRoleType,
DegradationPreference,
DirectCdnStreamingError,
DirectCdnStreamingReason,
DirectCdnStreamingState,
DirectCdnStreamingStats,
IDirectCdnStreamingEventHandler,
Expand Down Expand Up @@ -211,7 +211,7 @@ export default class DirectCdnStreaming

onDirectCdnStreamingStateChanged(
state: DirectCdnStreamingState,
error: DirectCdnStreamingError,
error: DirectCdnStreamingReason,
message: string
) {
this.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ export default class EncodedVideoFrame
);
}

protected override renderUser(): undefined {
return undefined;
}

protected renderAction(): ReactElement | undefined {
const { joinChannelSuccess } = this.state;
return (
Expand Down
Loading

0 comments on commit 2ab7994

Please sign in to comment.