This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Main process | |
| export const createSeeThroughWindow = () => { | |
| const w = new BrowserWindow({ transparent: true }); | |
| w.setIgnoreMouseEvents(true); | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const webpack = require('webpack'); | |
| const { RENDERER_INPUT, MAIN_INPUT, BUILD_OUTPUT } = require('./bin/config'); | |
| // Define a base configuration. | |
| const baseConfig = (env) => ({ | |
| plugins: [new webpack.DefinePlugin({ | |
| IS_PRO: env.IS_PRO ? true : false, | |
| IS_PROD: env.IS_PROD ? true : false, | |
| IS_PACKAGED: env.IS_PACKAGED ? true : false | |
| })], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unhandled from 'electron-unhandled'; | |
| unhandled({ | |
| logger: (error) => { | |
| // Handle all your errors here. | |
| }, | |
| showDialog: !IS_PRODUCTION | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import unhandled from 'electron-unhandled'; | |
| import mailgunInitializer from 'mailgun-js'; | |
| import { APP_VERSION, MAILGUN_PRIVATE, MAILGUN_SERVER } from './config'; | |
| const mailgun = mailgunInitializer(({ | |
| apiKey: MAILGUN_PRIVATE, | |
| domain: MAILGUN_SERVER | |
| })); | |
| unhandled({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| #Usage: ./icons.sh ../assets/media/icon_color_1024.png ../assets/icons | |
| name=$(basename "$1" ".png") | |
| dir=$(cd "$(dirname "$2")"; pwd)/$(basename "$2") | |
| mkdir $dir/$name.iconset | |
| sips -Z 16 --out $dir/$name.iconset/icon_16x16.png $1 | |
| sips -Z 32 --out $dir/$name.iconset/icon_16x16@2x.png $1 | |
| sips -Z 32 --out $dir/$name.iconset/icon_32x32.png $1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| convert icon_white.png -resize x1024 \ | |
| -size 1024x1024 xc:transparent +swap -gravity center -composite \ | |
| icon_white_1024.png |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { sign, flat } from 'electron-osx-sign'; | |
| import { PARENT_PLIST_PATH, CHILD_PLIST_PATH, PROVISIONING_PROFILE } from './config'; | |
| const signApp = (appPath, pkgPath) => { | |
| const resourcesPath = path.join(appPath, './Contents/Resources/'); | |
| const signOpts = { | |
| app: appPath, | |
| platform: 'mas', | |
| binaries: [ /* Here goes the list of binaries you have in your app, like the widevine plugin. */ ], | |
| entitlements: PARENT_PLIST_PATH, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { sign } from 'electron-osx-sign'; | |
| import { PARENT_PLIST_PATH, CHILD_PLIST_PATH, DEV_PROVISIONING_PROFILE } from './config'; | |
| const signApp = (appPath, pkgPath) => { | |
| const resourcesPath = path.join(appPath, './Contents/Resources/'); | |
| const signOpts = { | |
| app: appPath, | |
| platform: 'mas', | |
| binaries: [ /* Here goes the list of binaries you have in your app, like the widevine plugin. */ ], | |
| entitlements: PARENT_PLIST_PATH, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const video = document.querySelector('video'); | |
| video.addEventListener('error', () => { | |
| switch (video.error.code) { | |
| case video.error.MEDIA_ERR_DECODE: | |
| case video.error.MEDIA_ERR_SRC_NOT_SUPPORTED: | |
| // Video format not supported. | |
| break; | |
| case video.error.MEDIA_ERR_ABORTED: | |
| case video.error.MEDIA_ERR_NETWORK: | |
| default: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import ffmpeg form 'fluent-ffmpeg'; | |
| const filePath = '/Users/yoann/Desktop/video.avi'; | |
| const route = (req, res) => { | |
| res.writeHead(200, getHeaders({'Content-Type': 'video/mp4'})); | |
| ffmpeg(filePath) | |
| .format('mp4') | |
| .addOptions([ | |
| '-movflags frag_keyframe+faststart' | |
| ]) |