Detecting audio in third party online advertisements - javascript

Is is possible to detect when an online advertisement is playing audio? In an ideal world, I could do this through a browser in real-time and send a notification that would include the DOM information needed to remove the ad. In this type of model, I could theoretically then use all clients (web visitors) as test subjects. I believe that this might be far fetched, and thus will need to rely on a smaller subset of users. I'm looking for any way to do this. I have even thought about using speakers and a microphone to detect when a sound is playing, and then some how capture a screenshot and the DOM information. Please help. Thank you.

In a previous question, it was stated that this is not possible.
Edit:
No. The best you could do is maybe be able to detect that the browser is or is not playing sound. Even if you could do that, you would have difficulty detecting which tab or page was creating the sound. And if you could, you would have difficulty detecting the offending HTML. Could be flash, javascript, or HTML 5's tag. And even if you could do all of this, IE would surely (being the pain that it is) not support any of your attempts to complete this objective.
Bottom Line: You simply can't do what you are wanting to do. You would need to be able to query the browser for playing audio to be confident that you could handle all supported methods of playing sound in a browser. AFAIK, no browsers support this, so you are out of luck.

Related

how to prevent screen recording on a website in a web browser?

I am making an educational website for one of my clients and he demanded to implement a function that can prevent users to record the screen on the website because the website would have paid content and some Vimeo videos so he doesn't want to allow someone to steal his videos by doing screen record. I know this can be done for android or IOS apps. being a react developer I can also implement this for android apps using expo. but the client wants to do it for a website on a web browser. I've spent 4 hours, searching on the web, still am blanked because I didn't get a single solution.
can you please tell me how can I make it or even if it's possible or not?
Unfortunately, this doesn't appear to be possible. Currently, there is no way for a browser to understand if someone is recording the screen.
It would be quite a security risk if a browser were able to identify something as simple as a screen recorder. It would imply that a browser has far higher level permissions than it should have.
You should convey this to your client. Sometimes clients simply don't understand the technology.
Some people are doing it by detecting specific extension/ shortcut keys, stealing focus/ pausing video when focus out, etc. Some people follow some stealth way (finding software bugs). Also, some screen recorders may respect some meta/declaration. In this way, you may be able to prevent some common screen recorders but not all of them.

How does Disney+ prevent screen recordings of their content?

I tried to take a screenshot of a movie on the Disney+ web app when I realised that the video turns black as soon as I try to take a new screenshot with Snipping Tool. When I tried to do the same thing with OBS and Discord streams, I saw the same effect.
Interestingly, this only works for Chrome on my machine (I also tried Firefox and Edge and they just let me record my screen).
When I saw this, I became really curious on how they achieved this.
Does anyone have any idea how I can recreate this for my own web projects?
I became really curious on how they achieved this.
They use Widevine.
Widevine homepage.
https://ottverse.com/widevine-drm-how-does-it-work/
https://en.wikipedia.org/wiki/Widevine
News reports:
https://www.cordcuttersnews.com/sadly-disney-wont-work-on-chromebooks-linux-some-android-devices-because-of-drm/
https://www.tomsguide.com/news/disney-plus-will-work-on-chromebooks
https://www.androidpolice.com/2019/10/22/disney-will-only-work-on-devices-that-support-the-strictest-widevine-l3-drm/
It's also used by Netflix, Hulu and others.
Widevine is Google's DRM system that's baked-in to Chrome.
All other major browsers have adopted it as well, because no-one will use a browser that can't access Netflix.
Mozilla's and Microsoft's support is less user-hostile and as you noticed.
It's just a standard HTML5 <video> element - when the browser downloads the video stream it will see that it's encrypted with Widevine and that engages the Widevine client-side code which does all the DRM biz.
Though there are HTML and DOM features that facilitate DRM, I'm unsure of the extent that any JavaScript is required to use it - as theoretically everything the browser needs to know to load the DRM system should be embedded in the raw media stream.
On Windows, I understand (though unconfirmed) that Widevine makes use of SetWindowDisplayAffinity to block screenshots.
Nothing stops you from doing this in your own native code (e.g. if you had an Electron fork), but please don't because it's a real dick-move to your users, in addition to not working at all if the user has the DWM disabled (e.g. they're running Windows 7 with Aero disabled).
Has anyone any idea how I can recreate this for my own web projects?
You'll need to license Widevine yourself. This is a complicated process intended only for large media production companies and content rightsholders, not individuals or small businesses.
Anyway, even if you could, please don't. Why would you want to make to harder for users to share and appreciate your media? Just stick it up on YouTube instead.

Is there a way, using streaming in the browser, to toggle the video stream on/off?

The current setup
I'm building a web application which will basically act as an internet radio, but with optional video content too.
The server will be using Icecast to provide the stream (although if required, I could definitely use something else).
The question
Is it possible to implement something, that would allow the user to seamlessly switch the video stream on or off, where the audio will keep playing uninterrupted, and both streams will stay synchronised too.
Synchronisation is only important per-client, not between clients. I don't mean just hiding the video stream either, the idea is to minimize bandwidth usage when not watching.
Watching the stream will happen from within the browser and I do not want to use something like a java plugin.
Support for older browsers doesn't matter, the latest versions of Edge, Safari, Chrome and Firefox is enough.
Turns out this isn't possible to do the way I wanted to (actually turn off the video stream).
Next best workaround is by using DASH and adding effectively an empty (or just black) video stream that can be switched to.

Sound in the browser seamlessly with JavaScript

I know, I know, this is a duplicate question of this and this. However, these questions are somewhat outdated, and I haven't found a suitable solution.
I would like an easy, cross-browser and cross-platform solution for playing sound in the browser using JavaScript. I use and love jQuery, and had a look at this pluggin. I've tested the demo but was disappointed. For example, I had to allow the application to play the file. I want it to just work without any plugin, authorisation, etc.
I know that the AngryBirds chrome extension plays sound in the browser seamlessly but I don't know how they do it. Any suggestions for seamless sound in the browser?
I like to use Sound Manager 2 for this. It depends on Flash. It looks like it hasn't been updated in a while though, so it might not be a good choice if it doesn't already work in all the browsers you care about. Support for the audio tag is getting pretty good.

Get default media player using Javascript?

Whether is it possible to get default media player using Javascript, customize play controls and control play functions (Play, Stop, Seek, Pause..etc)
Thanks in advance,
Sri
No. The operating system's idea of a default media player (if it even has such a concept) is not accessible to the web browser, and most media players can't be controlled from a web page's JavaScript code anyway.
(With good reason: exposing a highly complex program like a media player to the Internet is a dangerous proposition. If just one bit of code in the handling of any format the player can read has an exploitable bug, then now every web page you visit could embed a media player and use the security hole to take over your machine. Indeed, this has happened many times in the past with Windows Media Player, QuickTime and RealPlayer, even though they were designed to be Internet-facing.)
You can embed a particular media player that was designed for it, and fall back to another media player if not available. So you could try to embed WMP, then fall back to QT if that failed, and fall back to Real if that failed.
But really, the days when it made any sense to do this are long gone. Today's it's all about the HTML5 and Flash video. The embedding of media players is dead, and good riddance to it.
I'm not sure what you mean but if you're talking about Windows Media player specifically I'm sure their embed version will have some skin Params, etc., you can play with.
Although I would advise you to take a look at HTML5 Media Player (http://html5demos.com/video) which is customizable and controllable via JavaScript
Here's a certified library that would be helpful in pushing html5 to the limit when it comes to video embedding: http://www.kaltura.org/project/

Categories