当我们“打开”时捕获文件归档到电子应用 [英] catch the file when we "open with" file to a electron app

查看:63
本文介绍了当我们“打开”时捕获文件归档到电子应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们用电子应用程序打开文件时捕获文件

我已经在电子游戏中创建了媒体播放器,并且想要任何媒体只要在我的应用上单击鼠标右键并打开该文件,即可在我的应用中播放该文件,该视频应该会播放,但现在不存在。从技术上讲,我想捕获文件并在我的应用程序打开时播放它。

I have created media player in electron and want any media file to play inside my app whenever i right-click and open with my-app, should play the video, which not happening now. Technically, i want to catch the file and play it, whenever its open-with my-app.

我已经用电子创建了媒体播放器,希望任何媒体文件都能播放在我的应用程序内部单击鼠标右键并打开我的应用程序时,应该可以播放视频,而这种情况现在还没有发生。从技术上讲,我想在我的应用程序打开时捕获文件并播放它。

I have created media player in electron and want any media file to play inside my app whenever i right-click and open with my-app, should play the video, which not happening now. Technically, i want to catch the file and play it, whenever its open-with my-app.

我希望你们会帮助我找到答案。

I hope you guys will help me to find an answer.

推荐答案

在<$ c $上使用打开文件事件在macOS上运行时,在Windows上,您需要解析 process.argv 的c> app 对象。请参阅文档: https://electronjs.org/docs/all#event-打开文件macos

Use the open-file event on the app object when running on macOS, on windows you need to parse process.argv. See the docs: https://electronjs.org/docs/all#event-open-file-macos

这篇关于当我们“打开”时捕获文件归档到电子应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆