Cannot play offline video in production electron app - electron

I have an electron/ember app that allows users to store a video offline and play it later. The ember app uses a video tag with a computed property to swap out the video src from the server with the offline link. I am storing it using electron.getPath("userData") so for macOS it's in ~/Library/Application Support/<appname>. The problem comes when I create the signed distributable. The offline support works just fine when running with ember electron but as soon as a I sign and package it for release it no longer works. The video player itself loads but is just blank. Is there some limitation with using local files in release mode for electron?

The answer is https://github.com/electron/electron-compile/pull/199
tldr; skip authenticity checks on local files
const { app } = require("electron");
const { addBypassChecker } = require('electron-compile');
addBypassChecker((filePath) => {
return filePath.indexOf(app.getAppPath()) === -1;
});

Related

Flutter PWA URL gets truncate in a downloaded PWA (iOS)

I have a PWA deployed on Firebase (which has a unique identifier at the end of the URL) that is working in web browsers mobile/web. When I download this PWA (via Add to Home Screen in Safari on iOS) the unique identifier disappears. It's working fine on Mac and Android but doesn't know why the URL gets truncated (on iOS only).
https://localhost:8080/#/brand/71wh212972g (URL in browser while downloading PWA)
https://localhost:8080/#/brand/ (URL in download PWA on iOS)
I'm not sure what to add or remove from manifest.json to make it work for iOS.
start_url is used to define the launch url after the app is added to the home screen.
{
...
"start_url": "https://<your domain>/#/brand/71wh212972g"
...
}
The start_url member is a string that represents the start URL of the web application — the preferred URL that should be loaded when the user launches the web application (e.g., when the user taps on the web application's icon from a device's application menu or homescreen).
See start_url for details.

Launching an App from Custom URL from Safari not working as intended in iOS >12.3

We share the App deeplinks (Universal links) with our users over email, sometimes they get wrapped by email service providers for safety.
When user taps on these wrapped deeplinks, instead of opening the App directly it opens the url in Safari.
We have a page hosted on that url. We capture the deeplink there and try to open the App using Custom URL scheme (myurlscheme://). But if the App is not installed, we try to redirect the user to the App Store page.
It all worked okay until now, but seems like Apple made some changes in Safari in the new versions of iOS (>12.3).
What’s happening now is, if the App is installed and we open the App from Safari (from Custom URL), the App Store page opens in a split second after opening our App.
This is the Javascript code that we are using:
window.location.href = 'myurlscheme://';
setTimeout(function() {
window.location.href = "https://itunes.apple.com/us/app/myapp/id123456789?ls=1&mt=8";
}, 500);
Is anyone else experiencing this. If yes, were you able to find any solution?
Update:
If we set the timeout to 4000 (i.e. 4 seconds), then it does not redirect to the App Store after launching the App.

Play youtube video as a hololgram

Is there any way to open a window and playing a youtube video inside my hololens app?
I did search about opening youtube video page, but it will open outside of my, i want player to be inside of my app.
For HoloLens 1, the suggestions provided by Hernando in the comments are good.
I wanted to also share that it is possible to do this on HoloLens 2 and Windows Mixed Reality simply by launching a URI. This will launch a flat application window directly in your unity app. For example, have a look at "the Launch External Apps pull request" which shows the behavior in the HandInteractionExamples scene (available in MRTK RC2 release, or latest mrtk_development branch).
The code to launch an external URI within your app is as follows:
#if WINDOWS_UWP
UnityEngine.WSA.Application.InvokeOnUIThread(async () =>
{
bool result = await global::Windows.System.Launcher.LaunchUriAsync(new System.Uri("https://youtu.be/SB-qEYVdvXA"));
}, false);
#else
Application.OpenURL("https://youtu.be/SB-qEYVdvXA");
#endif
This code was taken from LaunchUri.cs, modified to just launch a YouTube video.

How to play YouTube videos inside Meteor in Cordova?

I'm building a Meteor app that will be deployed to both iOS and Android. Some of the pages have an embedded YouTube player.
Locally and when deployed to Galaxy, the YouTube videos play without a hitch. When built for iOS, the videos do not play. When built for Android, the videos do play.
On iOS, nothing shows, though the iFrame that's supposed to hold the video is rendered. That is, an empty space is shown.
In mobile-config.js I have tried
App.accessRule('*://*.youtube.com/*');
App.accessRule('*://*.googlevideo.com/*');
and
App.accessRule('https://*.googlevideo.com/*', { type: 'navigation' } );
App.accessRule('https://*.youtube.com/*', { type: 'navigation' } );
But, for iOS, this makes no difference.
How to get YouTube videos playing in a Meteor app, built on Cordova, on iOS?
Try to edit your mobile-config.js from
App.accessRule('https://*.youtube.com/*', { type: 'navigation' } );
to
App.accessRule('*://*youtube.com', 'navigation');
The crux to solving this was using a particular Cordova package.enter link description here, installing it with:
meteor add cordova:com.bunkerpalace.cordova.youtubevideoplayer#https://github.com/Glitchbone/CordovaYoutubeVideoPlayer.git#765b5954e78ecf7950099c10bfe5f81133f8f396
I did not test if the access rules were necessary.

Approaches for debugging HTML5 video on an iPad

I'm writing a video encoder/server to serve video to a web application intended to run on an iPad. The iPad uses an HTML5 video tag to retrieve and decode the video, and I'm running into issues where the encoded video isn't being decoded correctly.
Is there anything like a system log on the iPad where I can find any information about what the video decoder finds objectionable in my bitstream, or any other way of getting some visibility into the decoding process?
Older versions of IOS allowed you to turn on the Safari debug console (settings ->safari->advanced -> debug console). This was handy for logging errors etc. If you are a mac user apparently there is a nice interface for doing so.
If you have desktop Safari you can also fake the user agent see: http://www.dummies.com/how-to/content/how-to-activate-user-agent-switcher-in-safari.html this will allow you to use web debug tools to see whats going on.
Alternatively you can create a 'Debug' panel in your webapp and hijack the console.log function so you can see errors etc.
Example:
<div id="debug-info"></div>
<script>
(function(){
var oldLog = console.log;
console.log = function (message) {
// DO MESSAGE HERE.
oldLog.apply(console, arguments);
$('#debug-info').prepend('<p>'+message+'</p>')
};
})();
</script>

Resources