reproduce:
go to http://jsbin.com/bules/1/
open console
go to net panel
see a lot of requests almost every 3seconds from youtube
With open console in chrome it causes memory leak after an hour or so.
Can someone explain why is that happening and why is this call so frequent?
The HTML5 youtube iframe do pulling every ~10 seconds, I guess they are doing it with some sort of socket with Flash and couldn't find a more reliable way to do it with HTML5 (eg: WebSockets are not implemented everywhere).
So this is just part of the normal YouTube HTML5 iframe behavior. Hopefully it will get fixed and replaced by a better system one day.
It's caused by a polling from the player. It checks whether I have my paired smartTV is turned on or not. So it can hide/show the remote-screen button on player.
I found this question when googling to solve the problem. I have the same problem (still, YT haven't solved in a better way). I had requests every ~5 sec. The client (FF) was sending the requests no matter if I had a youtube page up or not.
I found this is solution:
https://support.google.com/youtube/answer/3230451?hl=en
I couldn't manage to turn it off with the instructions for On computer, I had to do it from the TV. And the restart FF to get rid of it.
Related
The problem:
On my website mrgigi.me, I have 3 videos that start playing once the videos are visible in the viewport with javascript's .play()/.pause() API.
However, after a few seconds of playing the videos they all freeze on a frame. Checking in the console if the videos are paused with videoID.paused, returns the boolean false.
Meaning that the browser still thinks that the video is playing without any problems.
Using the play/pause buttons also do not work after the video freezes.
A few things to be noted:
This only happens on mobile, on desktop it works perfectly fine.
I am using an iPhone 13 Pro on, at the time of writing, iOS 15.4.1
I tried different mobile browsers which include:
The default browser, Safari
DuckDuckGo Browser
Brave Browser
This only happens when the website is deployed/hosted (so going to the website's domain). It works perfectly fine when using a local server like Live Server
For hosting, I'm using Firebase and Cloudflare
All the code can be found on the GitHub repository: DarthGigi/mrgigi.me
Here are a few videos demonstrating the issue:
Video showing the bug
Video showing the console output
It seems like there was nothing wrong with the code but with the hosting platform I was using, Firebase.
I do not know what the problem exactly was with Firebase, so I switched to Vercel (GitHub Pages would have fixed it too).
Thanks to Jack Latimer for helping me find the cause of the problem and also providing a fix for it!
One website I regularly access on my iPad has various JavaScript elements which stop working after around 15 minutes of use (it appears not to be after a set number of actions, if I do one interaction then leave it 15 minutes I have the same problem).
The problem happens on two different iPads on the same network. A fairly old iPad 3 with latest iOS 9.3.5 and a brand new iPad Mini 2 also with latest iOS. If I use mobile internet connection (tethered to my phone) rather than my in-house Wifi I don't have the problem.
The problem doesn't occur on desktop browsers, even when running as an iPad by updating the agent.
The website owners are supposedly investigating, but have said they can't recreate on their mobile test devices. Don't know how hard they have tried mind you!
Originally I though that the only thing that can make the website work again was to switch off and power on again the iPad. Closing the tabs, or the whole browser, or clearing history etc, makes no difference, only powering off and on again. I have more recently figured out that just disconnecting from the network and reconnecting, then reloading the page appears to reload the failing Javascript elements.
Using private browsing until the problem occurs and then closing down the tab, leaving private browsing, and then re-entering has certainly cleared all information as I have to login to the website again, but the problem persists.
So my question is, what could a network do to stop loading javascript parts of a webpage that disconnecting and reconnecting would fix? i.e. what might I have to fix on my home network? If there is any other information I can give, please do let me know.
I'm developing a site with the Soundcloud HTML5 widget and am having trouble loading the widget. It was working fine, but after a lot of page refreshes during development, the widget stops loading. Clearing cookies doesn't work, but opening the page in incognito or a new browser does work. I'm assuming it has something to do with frequent page refreshes, which shouldn't be a problem in production, but it makes me nervous that it might seize up.
Does this issue sound familiar to anyone. The fact that clearing local storage and cookies does nothing, but it does work consistently in another browser or incognito confuses me.
Have you tried looking at your console? (F12 in Chrome and IE), I have experienced these issues when I tried to load to many streams in a short time, preventing access to SoundCloud for a few.
Posting your code could help us give a more specfic answer.
Since this Chrome issue resulted in jPlayer 1.6.0 using the Flash solution for mp3 playback in Chrome 36, I've discovered my mp3s won't play via the Flash plugin. The mp3s play fine via the HTML5 solution in Firefox 30 and IE 11.
Note I'm not interested in fixing playback to use HTML 5 instead of Chrome - the newest version of jPlayer does that. Instead, I want to understand why playback via Flash is not working.
The mp3s are hosted on archive.org.
What I observe when I start playing is that in the Chrome Network inspector, I get one request for the mp3 URL with Status Finished, and then another request for the same URL that sits in Status (pending) forever.
What I see in Firefox from the HTML5 solution is two requests to the mp3 URL that both receive 302 redirects, and then a long running request to the actual mp3 URL which successfully streams the mp3 for playback
jPlayer inspector shows the progress and timeupdate metrics twitching between 3 and 4, and loadstart, play and waiting having all occurred but sit at 0.
So I think the Flash player isn't handling the redirect probably. But I'm unsure of how to go about troubleshooting this issue.
I've created a JSFiddle http://jsfiddle.net/e4WnF/4/ to demonstrate the issue.
I've attempted to use Wireshark to work out what is going on. Whilst with Firefox using the HTML 5 player I see the GET request that results in a 302, I see no sign of this GET request under Chrome.
I've worked around the issue by moving to jPlayer 1.6.4, but this doesn't change the fact that my mp3s will not work in browsers without HTML 5 audio support.
Thanks
This is a problem affecting loads of people, and it's caused by a recent Chrome change, which has now been rolled back, however until that filters through to the updates, you'll need to make some changes. Over at the jPlayer group there are at least ten threads and a jplayer bug ticket about this issue. There's also a Chrome bug tracker ticket about this.
It turns out that jPlayer and other sites like Soundcloud weren't actually sticking to the RFC 3003 spec, and when Chrome tightened up their code, this broke it. Chrome have now rolled back this change, but until that filters through, you can either download the latest jplayer code from github, or make the following immediate change to the jquery.jplayer.js file around line 696 so that it looks like this:
mp3: {
//codec: 'audio/mpeg; codecs="mp3"',
codec: 'audio/mpeg',
flashCanPlay: true,
media: 'audio'
},
Please let me know if this fixes things.
Is it possible to keep a html 5 web pages WebSocket connection open in Mobile-Safari once the screen is locked?
I want to send my users continuous updates throughout the day and it seems silly that their screens should always have to be unlocked to receive those notifications.
Are there any other options?
I don't think it's possible to keep the connection open while the browser is in the background, or when the screen is locked, the reason being that the app is essentially frozen in memory. Here's a quote from a similar question:
the reason you cant keep a network socket open, is that without your app jumping to the foreground when it receives a connection, it cannot respond to network traffic(because if it is not in the foreground its memory content is frozen).
However, I did find this page on Push Notifications for Websites that shows you 'how to sign up your users to receive notifications even when your site is not running in Safari'.
There are some other options: if you want to send continuous updates, you could write an app and either follow the instructions on Apple's site to keep a socket open permanently, or you could configure the app to implement Push Notifications.
I'm sorry I couldn't find a quick fix, but I hope at least one of these options works for you!
I have found a hacky way to keep WebSocket alive in Mobile Safari.
Basically it's the same solution as for this question.
Create an infinity looping audio file to keep Javascript running:
<audio loop src="http://www.sousound.com/music/healing/healing_01.mp3"></audio>
Note: some user interaction is required to initiate the audio file.
It would be nice if a WebSocket kept the browser alive in the same manner as an audio or video file.
PS this also works on Android.