How to include 1x 1080p and 2x 4K video assets for tvOS - tvos

I have an app that plays videos using AVFoundation APIs. These videos are currently placed into the project as separate files. They're 1080p videos, but now I have new 4K versions that I would like to use when the app is run on 4K Apple TVs, and it should continue using the 1080p assets on HD Apple TVs. I don't want both resolutions included in the app as that would dramatically increase the download size. App thinning does this for image assets placed in the asset catalog for 1x and 2x scales, but unfortunately it seems this isn't available for videos. Is there a way to provide 1x and 2x video assets such that the appropriate resolution is provided based on the Apple TV hardware downloading the app? Perhaps with on-demand resources? I do want the assets to always be available - the user shouldn't have to download them after the app is installed.

In response to feedback I submitted, I was informed this is possible if you use a Data Asset in Asset Catalog and the NSDataAsset API to retrieve the video. Tag the 4K version of the asset with the “APPLE 3” graphics feature class and put the 1080p version in the Any/Any slot. This will ensure the 4K version of the video asset is included for 4K Apple TV devices and the 1080p version is included for the others.

Related

How to make HTML <video> tag show black during screen capture? [duplicate]

I noticed that netflix employs a method of preventing users from recording or even taking still screenshot images of the video playback in their browser-based app.
If you are watching a video on netflix (in my case Windows 10 and Chrome) the video will turn to a black screen if you begin to record or screenshot.
What technology is at play here. Is there a windows/chrome API for telling content on the screen to hide if an attempted screenshotting is detected?
Is it possible for a web developer to add this feature to their products?
Most streaming media services now make use of EME https://en.wikipedia.org/wiki/Encrypted_Media_Extensions. The media players built by these services make use of EME to invoke the underlying DRM (Digital Rights Management)
WebBrowser -> HTML5/Javascript -> EME -> DRM
And yes, of course you can build your own solution using EME.
To add to the other answers and comments - the screen capture prevention mechanisms are actually dependent on the DRM security level and the device capabilities and so may be different on different machines.
Browsers using a SW based DRM solution which is not linked in to the secure media path on the device actually will allow screen capture.
Browsers using a HW based DRM or a SW one which is linked to the device secure media path will prevent screen capture.
Typically streaming services restrict their high resolution content, e.g. 4K, and sometimes even their high value content, e.g. live sports, to devices which support a secure media path. You can see this with popular streaming services where you may be able to stream a video in 4K on one browser/device combination but only in 720p on another, even on the same device.
Content security is an ever changing domain so you may find a particular browser and device combination supports different security levels over time.
Hardware Acceleration — you need to disable it.
in macOS, you can screenshot in Netflix —> Chrome > Settings > System > Disable Hardware Acceleration.
2cents from toronto island
jp

Web browser offline application cache with video files?

I am trying to make a site available offline in a web browser (specifically: Mobile Safari and/or Google Chrome), using a manifest file to load the offline content into the application cache.
This works just fine for images, html content and even font files. But not so for the videos I am trying to store. Mobile Safari is asking to increase storage to 50MB (just as it should) to accomodate the videos, but when going offline the videos are not displayed. All in all the cached content amounts to 37MB.
I am using JWPlayer to show the videos (setting the HTML5 player version as the preferred player), but I have also tried the HTML5 video tag on its own to no avail. The JWPlayer is returning the "Could not load video file" message, just as if the URL was invalid, when going offline (but they work fine online). The videos are H264 encoded in MP4 containers.
Is Mobile Safari on iPad at all capable of storing and retrieving MP4 (or other video) files? Is there any special trick that needs to be employed?
The problem is that Safari itself doesn't play the videos. They're played by the QuickTime plugin, which ignores the browser's caches. See this article.
I don't know of any workaround (other than PhoneGap etc.), but I would certainly love to have one!
You could not use the JWplayer in offline (at least with your current version). In their script (swf), it is fetching some external script from their server (include their logo) such as
http://p.jwpcdn.com/ ... /jwpsrv_frq.js
http://p.jwpcdn.com/...../jwpsrv.js
http://p.jwpcdn.com/...../logo.png (JwPlayer text)
I think it's all about their authorization and license checking. It would take you an amount to get away that logo for the paid version, they may ask your domain and they will add it into their list of the customer's valid website domain, and they also give you a script in the static link and you can add it into your cache file.

how to launch resident vid player from mobile site

im trying to launch the resident vid player in a phone from a url on a mobile site
and having a tough time doing this
there are lots of complexities
1) the vids are on amazons cloudfront
2) they are signed and streaming
3) i want to write one codebase and have it work for both iOS and android
so ive got the signed and streaming bit to work on the normal desktop site
and using flowplayer
in order to keep to the one codebase idea
im using html5/jquery mobile
so whats the html5 that will launch the vid player for both platforms
is there even such a thing
thanks so much for your help
Checkout jw player http://www.longtailvideo.com

jQuery Mobile video website, convert to PhoneGap app with videos on SD card instead of streamed

I have a jQuery Mobile website I created for a friend/client of mine. It only has 6 pages or so (2 of them are dialog windows). The site has HTML5 video with fallback for flash support via the videojs library. All videos are encoded properly in mp4, ogv (theora), and webm and so far play on every device I have used.
My problem lies bandwidth, the purpose of the program really needs to be an application because these are informational videos that may need to be viewed at any time, even with no web access (web access is required for first login to verify credentials).
I was left with 3 solutions, try writing native apps for all the platforms myself in their native languages, use Sencha Touch (which I am comfortable enough with extJS to do), or taking my existing jquery mobile app that is 100% functional including log-in and some backend package management to assign users a package of videos (there are multiple packages each with between 8-20 videos), and follow the jQuery Mobile tutorial for getting your app ready for PhoneGap, I believe its only enabling two settings, and both are to enable "cross-domain" requests, since my current web app would be running as localhost, it would see the scripts as external pages.
My main question/problem is for one, I have never used PhoneGap; aside from their Hello World android tutorial, and I know there are other all-in-one frameworks out there now: PhoneGap, Titanium, Corona, Adobe Flex (which I am installing while writing this tutorial, to see what it has to offer. If it has features like encoding videos automatically for the target device (video resolution changing), or even has local video playback features at all that may work.
Does anyone know which of the current frameworks have the ability to install a set of videos to the sdcard, (totaling around 6mb per install), and play them natively (by that i mean, in the devices native player, not inline inside of a webview). Which on android phones anyways, my current videojs based player plays the files natively in everything I have tried it on.
I just need a push in the right direction, if there is a PhoneGap plugin that I don't know about that allows videos to be played from the sd card, that would be terrific. Although I am not very happy with the speed of the android and blackberry webview controls. So something that uses 100% native controls would be great. I hope you guys can come up with some ideas, you can see the current app in action at m.yourvideobenefits.com email:abc#tool.com password: demo
You should view it from your phone if you want to see it properly, but if you do not have a smart phone; keep in mind that when viewing this page certain desktop browsers, the videos become their actual size after they are through loading. This is because i have autoload="true" in the video tag (which is ignored on most phones, but believe it or not, setting autoload="true" is what actually allowed the videos to not play inline on certain devices. A bug on the device, I am sure...but without this tag the videos played inline on iPhone 4 with the latest iOS version.
You could do it very easily with phonegap; you already have your web page, so it would be much less work, probably.
You could get the videos from inside your apps bundle in ios, and then it wouldn't be hard to select the one with the best resolution for the device being used. You could also download the videos at the perfect format and resolution the first time your app plays from your server using the file api. That convined with the storage api is nice for actualizations.
There's a plugin I use for android, because video tag is sometimes bugged or doesn't work at all in older versions, https://github.com/phonegap/phonegap-plugins/tree/master/Android/VideoPlayer.
It only plays from web or sdcard, but that's rarely too bad.
I can't help you with black berry, but I'm pretty sure there must be a way of doing it. And, anyway, appcelerator doesn't support it yet, so you would probably had to do it natively. Even if there isn't a plugin for black berry, you'd probably have to chose between native developement and html5 player inside phonegap. I won't give you my opinion about it here, for I'm not the one to give it and Stack Overflow says I shouln'd give it anyway.

Adobe Air Mobile: offline playback of DRM videos

I have videos with DRM using flash Access. I would like to be able to play these videos on mobile devices using Air when offline. It is possible to play streaming DRM content on mobile devices but I'm unsure how to save a voucher for offline playback. Since DRMManager is not included in Air Mobile, is this possible and how would it be done?
If DRMManager is not available in the mobile runtime then there is no way to use it, simple as that. Welcome to the perils of coding in a scripting language, that is, being bound to the whims of the people who control the runtime source code.