electron

TypeScript prevents me from passing the correct constraints to getUserMedia

倖福魔咒の 提交于 2021-01-26 18:35:20
问题 I'm trying to get a screen to stream to my Angular 5 Electron app. I'm using the desktopCapturer provided by Electron. This is my code: loadCurrentScreensource() { desktopCapturer.getSources({ types: [ 'window', 'screen' ] }, (error, sources) => { if (error) { throw error; } console.log('Finding screen: ' + this.selectedScreenSource); console.log(sources); for (let i = 0; i < sources.length; ++i) { if (sources[i].id === this.selectedScreenSource.id) { console.log('Found screen'); const

媒体智能-淘宝直播流媒体互动实践 | D2 分享视频+文章

北战南征 提交于 2021-01-26 10:29:15
背景:今天给大家带来的分享主题是《媒体智能-淘宝直播流媒体互动实践》,内容分为5个部分,首先看看在淘宝直播的直播间里主播可以怎样给用户拜年;然后具体讲如何制作一个手势拜年的特效;接着介绍我们媒体智能整体的方案设计以及其中核心的工作之一,MediaAI Studio这样一款编辑器的实现;最后讲讲我们后续的建设方向。 目录 今天给大家带来的分享主题是《媒体智能-淘宝直播流媒体互动实践》,内容分为5个部分,首先看看在淘宝直播的直播间里主播可以怎样给用户拜年;然后具体讲如何制作一个手势拜年的特效;接着介绍我们媒体智能整体的方案设计以及其中核心的工作之一,MediaAI Studio这样一款编辑器的实现;最后讲讲我们后续的建设方向。 直播间里怎么拜年? 马上又要过年了,每次过年我们都会给亲朋好友拜年。那在直播间里,主播怎么给用户拜年呢?今年年初春节,我们做了一个项目,就是让主播可以在直播间里给自己的粉丝拜年,然后在直播间里出一些春节的氛围特效。 具体的设计方案就是主播在直播的过程中,实时识别主播的拜年手势,来触发一些春节氛围特效的渲染,同时实时识别主播的脸部,来跟随渲染一些人脸道具。 可以看到上面的几个效果示意,比如主播可以通过做一个爱心或者拜年的手势,来触发直播间的花字、对联或者礼花,也可以给主播的面部加上财神帽等人脸道具,增强直播间里的节日氛围。 制作手势拜年特效

媒体智能-淘宝直播流媒体互动实践 | D2 分享视频+文章

时间秒杀一切 提交于 2021-01-25 17:25:18
背景:今天给大家带来的分享主题是《媒体智能-淘宝直播流媒体互动实践》,内容分为5个部分,首先看看在淘宝直播的直播间里主播可以怎样给用户拜年;然后具体讲如何制作一个手势拜年的特效;接着介绍我们媒体智能整体的方案设计以及其中核心的工作之一,MediaAI Studio这样一款编辑器的实现;最后讲讲我们后续的建设方向。 直播间里怎么拜年? 马上又要过年了,每次过年我们都会给亲朋好友拜年。那在直播间里,主播怎么给用户拜年呢?今年年初春节,我们做了一个项目,就是让主播可以在直播间里给自己的粉丝拜年,然后在直播间里出一些春节的氛围特效。 具体的设计方案就是主播在直播的过程中,实时识别主播的拜年手势,来触发一些春节氛围特效的渲染,同时实时识别主播的脸部,来跟随渲染一些人脸道具。 可以看到上面的几个效果示意,比如主播可以通过做一个爱心或者拜年的手势,来触发直播间的花字、对联或者礼花,也可以给主播的面部加上财神帽等人脸道具,增强直播间里的节日氛围。 制作手势拜年特效 那么要在直播的过程中做到这些效果,需要怎么来制作呢。接下来就详细介绍如何在直播间里制作这样一个手势拜年的特效。 大体上分为4个步骤,第一步是设计师通过一些设计软件制作好静态或动态的素材,比如财神帽及相关的微动效,交付物可以是一个序列帧动画;第二步是设计师在我们自研的MAI编辑器里制作完整的素材包,在这个编辑器里可以做画幅的适配

angular 5 with electron-packager

倖福魔咒の 提交于 2021-01-25 07:30:32
问题 I try to build my electron project to window app by using electron-packager but I get this error. Failed to locate module "fsevents" from "/var/www/windowapp/electron-angular-project/node_modules/@angular-devkit/core/node_modules/chokidar" This normally means that either you have deleted this package already somehow (check your ignore settings if using electron-packager). Or your module installation failed. Anyone know how to solve it and what happened to this? 回答1: Here my 2 cent, I did a

Electron Windows增加托盘悬浮框功能

六眼飞鱼酱① 提交于 2021-01-24 08:53:29
背景 在做Electron Windows 桌面应用时候,做鼠标悬浮到托盘图标上时显示一个悬浮框(例如做消息提醒),但因为Windows没有提供托盘mouse-enter/mouse-leave事件,无法直接做这个功能,考虑到还有mouse-move事件,弄个间接的方式实现。 实现步骤 1、监听mouse-move事件,当触发时,即也相当触发mouse-enter事件。 2、开始定时(100ms)获取托盘位置和鼠标位置,判断鼠标是否还在托盘图标里,当已不在时,触发mouse-leave事件并停止定时查询。 //判断鼠标是否还在托盘图标 trayBounds = tray.getBounds(); point = screen.getCursorScreenPoint(); if (!(trayBounds.x < point.x && trayBounds.y < point.y && point.x < (trayBounds.x + trayBounds.width) && point.y < (trayBounds.y + trayBounds.height))){ // 已不在托盘,触发mouse-leave } 3、当mouse-enter时,显示悬浮窗口到托盘上方,当mouse-enter,隐藏悬浮窗口。 PS:悬浮窗口需要设置置顶属性,且不显示在任务栏。 具体代码

How to grant permission to audio in electron app in Windows?

杀马特。学长 韩版系。学妹 提交于 2021-01-24 07:23:37
问题 I'm trying to implement speech recognition into the electron application. The solution works in chrome browser, but does not work in electron. The application stops listening immediately - it probably has no microphone permission. How to grant permissions? index.js const electron = require('electron'); const url = require('url'); const path = require('path'); const { app, BrowserWindow, ipcMain } = electron; let mainWindow; ipcMain.on('close-me', (evt, arg) => { app.quit() }) app.on('ready',

Request microphone permission in electron

冷暖自知 提交于 2021-01-23 06:24:23
问题 I have an electron app that uses the webkit speech recognition API. If tested in the browser, everything works as intended, but if run in the electron environment, the speech recognition api doesn't work. What I mean is that when I press the button that starts the recording, the recording won't start in the electron environment. I believe that is because unlike when running the code in the browser, I wasn't asked for and therefore not granted microphone access. So my question is then, how can

SwitchHosts管理hosts

China☆狼群 提交于 2021-01-21 03:29:25
SwitchHosts 简介 SwitchHosts 是一个用于快速切换 hosts 的开源免费的小工具,基于 Electron 开发,同时使用了 React、Ant Design 以及 CodeMirror 等框架/库,支持跨平台(Windows、Linux、Mac); 我最初使用 SwitchHosts 是在很多年前的 Windows 平台下,那个时候 SwitchHosts 是基于 Python 写的,界面比较丑,好在使用方便,丑点也无所谓;经历几年的发展, SwitchHosts 变得越来越好看,功能也丰富了不少: gitHub 开源地址 gitHub 下载地址 百度网盘下载地址 SwitchHosts 主要功能: 快速切换 hosts hosts 文件语法高亮 远程 hosts 方案 图标快速切换 Linux 下 SwitchHosts 安装使用 Windows 平台和 Mac 平台都能傻瓜式安装使用,使用也没多大的难处。这里主要说一下Ubuntu下使用 SwitchHosts 的安装配置: 解压并移动到自己指定的目录下: unzip SwitchHosts-linux-x64_v3.3.9.5343.zip mv SwitchHosts!-linux-x64 ~/software/switchHosts 进入目录,执行 SwitchHosts 启动命令即可启动: cd

How can we send messages main process to renderer process in Electron

二次信任 提交于 2021-01-17 19:41:07
问题 I'm playing with electron for the first time. Trying to create a text editor In render I'm sending a message to indicated the content has changed and needs saving: document.getElementById('content').onkeyup = e => { ipcRenderer.send('SAVE_NEEDED', { content: e.target.innerHTML, fileDir }) } Then ipcMain receives it no problem. On the menu I have this: { label: 'Save', click: _ => { saveFile(message) // trying: // ipcMain.send('SAVED', 'File Saved') }, accelerator: 'cmd+S', // shortcut } So

How can we send messages main process to renderer process in Electron

时光总嘲笑我的痴心妄想 提交于 2021-01-17 19:38:34
问题 I'm playing with electron for the first time. Trying to create a text editor In render I'm sending a message to indicated the content has changed and needs saving: document.getElementById('content').onkeyup = e => { ipcRenderer.send('SAVE_NEEDED', { content: e.target.innerHTML, fileDir }) } Then ipcMain receives it no problem. On the menu I have this: { label: 'Save', click: _ => { saveFile(message) // trying: // ipcMain.send('SAVED', 'File Saved') }, accelerator: 'cmd+S', // shortcut } So