Skip to content

Commit

Permalink
Merge pull request AgoraIO#45 from AgoraIO/dev/2.4.1_improve-web
Browse files Browse the repository at this point in the history
Dev/2.4.1 improve web
  • Loading branch information
plutoless authored Jun 3, 2019
2 parents e24fa89 + d10a83d commit 0dfb913
Show file tree
Hide file tree
Showing 87 changed files with 28,518 additions and 522 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ cscope.out
cscope.po.out
tags

node_modules
**/*.js~
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ void CAGEngineEventHandler::onRemoteVideoStats(const RemoteVideoStats& stats)
lpData->delay = stats.delay;
lpData->width = stats.width;
lpData->height = stats.height;
lpData->receivedFrameRate = stats.receivedFrameRate;
lpData->rendererOutputFrameRate = stats.rendererOutputFrameRate;
lpData->receivedBitrate = stats.receivedBitrate;
lpData->receivedFrameRate = stats.receivedFrameRate;
lpData->decoderOutputFrameRate = stats.decoderOutputFrameRate;

if(m_hMainWnd != NULL)
::PostMessage(m_hMainWnd, WM_MSGID(EID_REMOTE_VIDEO_STAT), (WPARAM)lpData, 0);
Expand Down
3 changes: 2 additions & 1 deletion Group-Video/OpenVideoCall-Windows/OpenVideoCall/AGEventDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,8 @@ typedef struct _AGE_REMOTE_VIDEO_STAT
int width;
int height;
int receivedBitrate;
int receivedFrameRate;
int decoderOutputFrameRate;
int rendererOutputFrameRate;

} AGE_REMOTE_VIDEO_STAT, *PAGE_REMOTE_VIDEO_STAT, *LPAGE_REMOTE_VIDEO_STAT;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../../sdk/include;../sdk/include;</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);../../../sdk/lib;../sdk/lib;</LibraryPath>
<IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);../../../sdk/include;../sdk/include;../../sdk/include</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64);../../../sdk/lib;../sdk/lib;../../sdk/lib</LibraryPath>
<OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
Expand All @@ -92,8 +92,8 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<IncludePath>$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);../../../sdk/include;../sdk/include;</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSdk_71A_LibraryPath_x64);../../../sdk/lib;../sdk/lib;</LibraryPath>
<IncludePath>$(VC_IncludePath);$(WindowsSdk_71A_IncludePath);../../../sdk/include;../sdk/include;../../sdk/include</IncludePath>
<LibraryPath>$(VC_LibraryPath_x64);$(WindowsSdk_71A_LibraryPath_x64);../../../sdk/lib;../sdk/lib;../../sdk/lib</LibraryPath>
<OutDir>$(SolutionDir)\$(Configuration)\</OutDir>
<IntDir>$(Configuration)\</IntDir>
</PropertyGroup>
Expand Down
66 changes: 30 additions & 36 deletions Group-Video/OpenVideoCall-Windows/OpenVideoCall/VideoDlg.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// VideoDlg.cpp : 实现文件
// VideoDlg.cpp : ʵ���ļ�
//

#include "stdafx.h"
Expand All @@ -8,7 +8,7 @@
#include "AGEventDef.h"
#include "video_preprocessing_plugin.h"

// CVideoDlg 对话框
// CVideoDlg �Ի���

IMPLEMENT_DYNAMIC(CVideoDlg, CDialogEx)

Expand Down Expand Up @@ -98,14 +98,14 @@ BEGIN_MESSAGE_MAP(CVideoDlg, CDialogEx)
END_MESSAGE_MAP()


// CVideoDlg 消息处理程序
// CVideoDlg ��Ϣ��������


void CVideoDlg::OnSize(UINT nType, int cx, int cy)
{
CDialogEx::OnSize(nType, cx, cy);

// TODO: 在此处添加消息处理程序代码
// TODO: �ڴ˴�������Ϣ�����������
if (m_btnMin.GetSafeHwnd() != NULL)
m_btnMin.MoveWindow(cx - 72, 0, 24, 24, TRUE);
if (m_btnRst.GetSafeHwnd() != NULL)
Expand All @@ -117,7 +117,7 @@ void CVideoDlg::OnSize(UINT nType, int cx, int cy)
m_rcVideoArea.top += 24;
m_rcVideoArea.bottom -= 72;

// 2人, 右上角子画面区域
// 2�ˣ� ���Ͻ��ӻ�������
m_rcChildVideoArea.top = m_rcVideoArea.top + 10;
m_rcChildVideoArea.bottom = m_rcChildVideoArea.top + 144;
m_rcChildVideoArea.right = m_rcVideoArea.right - 14;
Expand Down Expand Up @@ -252,7 +252,7 @@ void CVideoDlg::AdjustSizeVideoMulti(int cx, int cy)

void CVideoDlg::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
// TODO: �ڴ�������Ϣ������������/�����Ĭ��ֵ

CDialogEx::OnMouseMove(nFlags, point);
}
Expand Down Expand Up @@ -326,15 +326,13 @@ void CVideoDlg::EnableSize(BOOL bEnable)
void CVideoDlg::OnPaint()
{
CPaintDC dc(this); // device context for painting
// TODO: 在此处添加消息处理程序代码
// 不为绘图消息调用 CDialogEx::OnPaint()
//CDialogEx::OnPaint()
DrawHead(&dc);
}


LRESULT CVideoDlg::OnNcHitTest(CPoint point)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
LRESULT lResult = CDialogEx::OnNcHitTest(point);
if (lResult == HTCLIENT && ::GetAsyncKeyState(MK_LBUTTON) < 0)
lResult = HTCAPTION;
Expand Down Expand Up @@ -475,7 +473,7 @@ void CVideoDlg::OnBnClickedBtnfullscr()

void CVideoDlg::OnBnClickedScreenshare()
{
m_dlgDesktopCapture.SaveScreen(NULL);
m_dlgDesktopCapture.SaveScreen(NULL);
m_dlgDesktopCapture.ShowWindow(SW_MAXIMIZE);
}

Expand Down Expand Up @@ -807,7 +805,7 @@ LRESULT CVideoDlg::OnRemoteVideoStat(WPARAM wParam, LPARAM lParam)
AGVIDEO_WNDINFO &rWndInfo = m_listWndInfo.GetNext(posNext);

if (rWndInfo.nUID == lpData->uid) {
rWndInfo.nFramerate = lpData->receivedFrameRate;
rWndInfo.nFramerate = lpData->rendererOutputFrameRate;
rWndInfo.nBitrate = lpData->receivedBitrate;
rWndInfo.nWidth = lpData->width;
rWndInfo.nHeight = lpData->height;
Expand Down Expand Up @@ -1064,7 +1062,7 @@ BOOL CVideoDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();

// TODO: 在此添加额外的初始化
// TODO: �ڴ����Ӷ���ij�ʼ��
m_dlgDevice.Create(CDeviceDlg::IDD, this);
m_dlgDevice.EnableDeviceTest(FALSE);

Expand All @@ -1078,7 +1076,7 @@ BOOL CVideoDlg::OnInitDialog()
m_bitMenuFilter.LoadBitmap(IDB_MENU_FILTER);

return TRUE; // return TRUE unless you set the focus to a control
// 异常: OCX 属性页应返回 FALSE
// �쳣: OCX ����ҳӦ���� FALSE
}


Expand Down Expand Up @@ -1132,7 +1130,6 @@ void CVideoDlg::RebindVideoWnd()

BOOL CVideoDlg::PreTranslateMessage(MSG* pMsg)
{
// TODO: 在此添加专用代码和/或调用基类
if (pMsg->message == WM_KEYDOWN){
switch (pMsg->wParam){
case VK_RETURN:
Expand Down Expand Up @@ -1196,33 +1193,31 @@ LRESULT CVideoDlg::OnWindowShareStart(WPARAM wParam, LPARAM lParam)
return 0;
}

LRESULT CVideoDlg::OnDesktopShareStart(WPARAM wParam, LPARAM lParam)
{
LPDESKTOP_SHARE_PARAM lpDesktopShareParam = (LPDESKTOP_SHARE_PARAM)(wParam);
CRect rcRegion;

CAgoraObject::GetAgoraObject()->EnableVideo();

rcRegion.left = lpDesktopShareParam->nX;
rcRegion.top = lpDesktopShareParam->nY;
rcRegion.right = rcRegion.left + lpDesktopShareParam->nWidth;
rcRegion.bottom = rcRegion.top + lpDesktopShareParam->nHeight;

CAgoraObject::GetAgoraObject()->EnableScreenCapture(NULL, lpDesktopShareParam->nFPS, &rcRegion, TRUE);
// Sleep(1000);
// CAgoraObject::GetAgoraObject()->SetVideoProfileEx(lpDesktopShareParam->nWidth, lpDesktopShareParam->nHeight, lpDesktopShareParam->nFPS, lpDesktopShareParam->nBitrate);

m_btnScrCap.SwitchButtonStatus(CAGButton::AGBTN_PUSH);

return 0;
LRESULT CVideoDlg::OnDesktopShareStart(WPARAM wParam, LPARAM lParam)
{
LPDESKTOP_SHARE_PARAM lpDesktopShareParam = (LPDESKTOP_SHARE_PARAM)(wParam);
CRect rcRegion;

CAgoraObject::GetAgoraObject()->EnableVideo();

rcRegion.left = lpDesktopShareParam->nX;
rcRegion.top = lpDesktopShareParam->nY;
rcRegion.right = rcRegion.left + lpDesktopShareParam->nWidth;
rcRegion.bottom = rcRegion.top + lpDesktopShareParam->nHeight;

CAgoraObject::GetAgoraObject()->EnableScreenCapture(NULL, lpDesktopShareParam->nFPS, &rcRegion, TRUE);
// Sleep(1000);
// CAgoraObject::GetAgoraObject()->SetVideoProfileEx(lpDesktopShareParam->nWidth, lpDesktopShareParam->nHeight, lpDesktopShareParam->nFPS, lpDesktopShareParam->nBitrate);

m_btnScrCap.SwitchButtonStatus(CAGButton::AGBTN_PUSH);

return 0;
}

void CVideoDlg::OnShowWindow(BOOL bShow, UINT nStatus)
{
CDialogEx::OnShowWindow(bShow, nStatus);

// TODO: 在此处添加消息处理程序代码

if (bShow && GetSafeHwnd() != NULL)
RebindVideoWnd();
}
Expand All @@ -1232,7 +1227,6 @@ void CVideoDlg::OnMove(int x, int y)
{
CDialogEx::OnMove(x, y);

// TODO: 在此处添加消息处理程序代码
CRect rcChatBox;

rcChatBox.SetRect(x, y + m_rcVideoArea.Height() - 126, x + m_rcVideoArea.Width(), y + m_rcVideoArea.Height() + 24);
Expand Down
3 changes: 3 additions & 0 deletions One-to-One-Video/Agora-Web-Tutorial-1to1-Webpack/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
build
dist
package-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# AgoraRTC Web Tutorial Webpack Sample

## Basic Communication Example
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Basic Communication</title>
</head>

<body>
<div class="sections-container">
<div class="section-container">
<div class="section-body">
<div class="notice"></div>
<div class="section-title">
<div class="title" id="basic">Basic Communication</div>
<hr/>
</div>
<!-- form -->
<form id="form">
<div class="section-form">
<div class="form-row">
<div class="form-item">
<label for="appID">APPID: </label>
<input placeholder="Enter APPID" type="text" id="appID" name="appID"/>
</div>
<div class="form-item">
<label for="channel">Channel: </label>
<input placeholder="Enter Channel" type="text" id="channel" name="channel"/>
</div>
<div class="form-item">
<label for="uid">UID: </label>
<input placeholder="Enter UID" type="text" id="uid" name="uid"/>
</div>
<div class="form-item">
<label for="token">Token: </label>
<input placeholder="Enter Token" type="text" id="token" name="token"/>
</div>
<div class="form-item">
<label for="microphoneId">Audio Device: </label>
<select id="microphoneId" name="microphoneId" class="custom-select">
</select>
</div>
<div class="form-item">
<label for="cameraId">Video Ddevice: </label>
<select id="cameraId" name="cameraId" class="custom-select">
</select>
</div>
</div>
<hr/>
<div class="form-row button-list">
<a class="btn" id="create">create room</a>
<a class="btn" id="publish">publish</a>
<a class="btn" id="unpublish">unpublish</a>
<a class="btn leave" id="leave">leave</a>
</div>
<hr/>
<div class="video-grid" id="video">
<div id="local_stream" class="video-placeholder">
<div id="local_video_info" class="video-info"></div>
</div>
</div>
</div>
</form>
<!-- from -->
</div>
</div>
</div>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "Agora-Web-Tutorial-Webpack-1to1-Basic-Communication",
"version": "2.6.1",
"description": "",
"main": "index.js",
"scripts": {
"start": "cross-env NODE_ENV=development webpack-dev-server --config ./scripts --mode development",
"build": "cross-env NODE_ENV=production webpack --config ./scripts --mode production"
},
"dependencies": {
"agora-rtc-sdk": "^2.6.1",
"jquery": "^3.4.1",
"toastify-js": "^1.5.0"
},
"devDependencies": {
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.4.5",
"babel-loader": "^8.0.6",
"clean-webpack-plugin": "^2.0.1",
"cross-env": "^5.2.0",
"css-loader": "^2.1.1",
"file-loader": "^3.0.1",
"friendly-errors-webpack-plugin": "^1.7.0",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.11.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.23.1",
"webpack": "^4.29.6",
"webpack-cli": "^3.3.0",
"webpack-dev-server": "^3.2.1"
},
"keywords": ["agora", "agora-rtc-sdk", "webrtc"],
"author": "agora",
"license": "ISC"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
const path = require("path");
const loaders = require("./loaders");
const plugins = require("./plugins");

const NODE_ENV = process.env.NODE_ENV

const distPath = NODE_ENV == 'development' ? '../dist' : '../build'

module.exports = {
entry: {
index: "./src/index.js",
},
devtool: "inline-source-map",
module: loaders,
plugins,
resolve: {
extensions: [ ".js" ],
},
output: {
filename: "[name].[hash].js",
path: path.resolve(__dirname, distPath),
},
optimization: {
minimize: false,
},
devServer: {
overlay: {
warnings: true,
errors: true,
},
hot: true,
contentBase: path.join(__dirname, "./"),
compress: true,
progress: true,
open: true
},
};
Loading

0 comments on commit 0dfb913

Please sign in to comment.