i wanted to ask a question regarding this chrome extension called Turn Off The Lights , im aware of how to dim the background using jquery and css etc.. but what i am interested in knowing is how to get the current video playing from popular websites like YouTube, dailymotion etc.. before applying the jquery effects..?
search with javascript to this "movie_player" id (YouTube only) and check if it's playing, if yes -> dim the web page.
More information about detecting the video player status, see this API link:
https://developers.google.com/youtube/js_api_reference#Playback_controls
I can only assume that it looks for or elements in the page using some selector.
Then it would add the div to dim the background using a content script, changing the z-index of the found video element to a higher value.
Related
Question: how to prevent YouTube video name from showing up when changing volume in Windows 10. [YouTube IFrame Api]
What I don't want:
Image of what I don't want
I don't want the name of the YT video to show up when changing volume. It's really annoying and I can't find any way to disable it.
Is there some kind of playervar that stops this?
Thanks!
It appears that you currently cannot change Chrome flags to disable this from code. The best you can do is provide a direct link to the setting, as the flags page supports direct links to specific settings: chrome://flags/#hardware-media-key-handling
In the meantime, we'll just have to wait and make feature requests to Google. Maybe they can add a popup that says, "This website is trying to change a setting...", or something.
It is a browser feature, If you are using chrome you can disable this feature by navigating to chrome://flags/#hardware-media-key-handling and then disable Hardware Media Key Handling
I am building a WordPress site and have embedded a video using WP's built in video-short code. My goal is to cause the video to auto play or not, dependent on the presence of a cookie. WP appears to use MediaElement.js.
In JS I have the cookie detection sorted, but no matter what I try I can't figure out how to trigger the video to play. I am not sure if I'm just not selecting the correct element, but I'm currently trying:
jQuery(".mejs-video").play();
The console shows error: "Uncaught TypeError: jQuery(...).play is not a function"
How can I select and trigger the video generated by the shortcode?
I find a solution for myself like this :
$('.mejs-play button').click(); // Play
$('.mejs-pause button').click(); // Pause
I dont think it's the best solution (video API will be the best), but it work :)
Is there a way to programmatic-ally control audio level on tabs i want to regardless of how web app was designed (be it HTML5 Audio element or Flash, etc.)?
Just to make it clear i don't intend to research web page for some "id" "elements" or whatsoever, but something like Chrome.ThisAudioOutputLevels...?
Admitting that the audio comes from a <audio> HTML element, you can try to get all audio elements from the DOM and lower their volumes. I was suffering from this with google hangouts meetings where I couldn't lower the audio because it had no control whatsoever.
"The solution"
I selected all <audio> elements and lowered their volumes. Follow these steps:
Open your console on the given tab. (Press F12).
Select all audio elements.
Lower each audio volume.
let audios = [...document.getElementsByTagName('audio')];
audios.forEach(audio => audio.volume = 0.5) // lower volume 50%.
Volume range = {0..1} where 0 = no volume.
This is more of a comment than an answer, but I can't comment, so:
Browsers generally try not to change how the content is meant to be displayed, including sound. For this reason, I would be surprised if there were such a feature.
If you're trying to simply mute tabs, you could take a look at chrome://flags/#enable-tab-audio-muting
Alternatively you could use tampermonkey or a similar extension and run a search for all audio/video tags and change the volume, but you said you didn't want to search for specific elements. To my knowledge (and Google's) as of right now there is no volume control for an entire page.
I am using JavaScript to wrap an HTML5 video player in a div for styling purposes. If the mark-up exists when the page loads, the player functions as it should. However if I apply the wrapper dynamically with JavaScript, the player goes black and its controls are inaccessible. I have tested applying various elements as wrappers, and it seems to happen with any block level element, but not inline elements. I can't find any documentation on this bug or others who have encountered it via Google. Anyone have a workaround?
I see this was posted a long time ago & I ran into a similar issue.
When a video is reparented (like it would be if you used a solution like slick, it reverts to 00:00 and pauses. Once reparented, you should be able to directly access the video via JS & invoke the play() method to get it started again.
Is there a way to get moxie player, which is packaged with TinyMCE, to display a splash image when you embed a video via the WYSIWYG tool? I've been Googling and playing with it for a while with no success at this point. I'm using TinyMCE 3.4.2 in production and have tried 3.4.3 in development, but it doesn't seem to work correctly. Honestly, I'm not even sure what the actual params are for this player since the documentation on the legal flashvars appears to be non existent. From what I can tell, the "poster" param should be what I need, but setting that when I embed the video object seems to do nothing. The only official documentation I've found so far is: http://tinymce.moxiecode.com/wiki.php/Plugin:media and that just gives the general params to pass into TinyMCE for the media plugin itself, not how to actually use the player.
Here is what I'm currently setting in the flashvars param tag
<param name="flashvars" value="url=http%3A//url/to/some.flv&poster=http%3A//url/to/some.jpg" />
Any ideas? I'd prefer to keep using the stock TinyMCE implementation if at all possible and this player, along with the WYSIWYG tool otherwise addresses the business issue perfectly for my company.
You can't do it with current version of moxieplayer.
swfdump (from Flex SDK) on moxiplayer.swf doesn't show any reference to the poster parameter, just the url one.
This is an open request feature. Just vote for it!
Currently you can only set a poster image using the HTML5 Video tag. You can validate this here by clicking the insert media button, selecting HTML5 video and assigning a poster image in the advanced tab.
After that just hit submit to see the resulting example and the corresponding HTML.