<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Javascript on Everyone Has a Story</title><link>https://bhaveshsgupta.com/tags/javascript/</link><description>Recent content in Javascript on Everyone Has a Story</description><generator>Hugo</generator><language>en-us</language><managingEditor>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</managingEditor><webMaster>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</webMaster><lastBuildDate>Tue, 06 Oct 2026 18:26:36 +0530</lastBuildDate><atom:link href="https://bhaveshsgupta.com/tags/javascript/index.xml" rel="self" type="application/rss+xml"/><item><title>Slide sync over HLS with ID3 timed metadata</title><link>https://bhaveshsgupta.com/blog/hls-cdn-3-id3-slide-sync/</link><pubDate>Tue, 06 Oct 2026 09:02:00 +0530</pubDate><author>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</author><guid>https://bhaveshsgupta.com/blog/hls-cdn-3-id3-slide-sync/</guid><description>&lt;p&gt;A webcast with slides has to change the slide at the moment the presenter does, as the viewer sees it. Viewers are 10 to 30 seconds behind live, each by a different amount, so a message sent &amp;ldquo;now&amp;rdquo; from the presenter&amp;rsquo;s page arrives at the wrong time for everyone. The fix is to put the slide change inside the stream itself, at the right timestamp. In HLS that means ID3 timed metadata.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;In short:&lt;/strong&gt; To change slides at the exact moment the presenter did, put the change inside the stream as ID3 timed metadata. Each tag rides in the segment on its own data stream with a presentation timestamp, so the player fires it at the right frame however far behind live the viewer is. Put every tag in every quality, re-send the current slide regularly for late joiners, and read the tags through the video element&amp;rsquo;s metadata text track, which works in hls.js and Safari.&lt;/p&gt;</description></item><item><title>The Fizzbuzz Problem 2</title><link>https://bhaveshsgupta.com/blog/the-fizzbuzz-problem-2/</link><pubDate>Tue, 02 Feb 2021 08:56:01 +0530</pubDate><author>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</author><guid>https://bhaveshsgupta.com/blog/the-fizzbuzz-problem-2/</guid><description>&lt;p&gt;Last time I had stopped optimizing this the problem more because we were having a discussion where string concatination is a costly opperation. So yesterday I was talking with Nishchay how can about the previous blog and other things at that point we started on optimizing this further avoiding string contactination as well.&lt;/p&gt;</description></item><item><title>The Fizzbuzz Problem</title><link>https://bhaveshsgupta.com/blog/the-fizzbuzz-problem/</link><pubDate>Sun, 31 Jan 2021 16:42:25 +0530</pubDate><author>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</author><guid>https://bhaveshsgupta.com/blog/the-fizzbuzz-problem/</guid><description>&lt;p&gt;Recently I have been giving few interviews and I have faced this problem twice or thrice I guess where an interviewer asks me this problem.&lt;/p&gt;</description></item><item><title>Javascript uses utf16 and Html utf8, then how things work together?</title><link>https://bhaveshsgupta.com/blog/javascript-utf16-and-html-utf8-how-things-work-together/</link><pubDate>Tue, 17 Jul 2018 05:45:40 +0530</pubDate><author>BhaveshSGupta@disroot.org (Bhavesh S. Gupta)</author><guid>https://bhaveshsgupta.com/blog/javascript-utf16-and-html-utf8-how-things-work-together/</guid><description>&lt;p&gt;This was part of one the discussion of dgplug discussion, that javascript uses utf-16 and html we usually use utf-8 as character encoding then how things work out.&lt;/p&gt;&#10;&lt;p&gt;This was quite interesting on how things work around because of this. So I was reading around to find answers for the above question and I landed upon &#10;&lt;a href="https://stackoverflow.com/questions/12114477/how-do-i-correctly-insert-unicode-in-an-html-title-using-javascript/12114520#12114520" target="_blank" rel="noopener noreferrer"&gt;this&lt;/a&gt;&#10;. And this text from the answer in the link helps understand how things work. &amp;ldquo;JavaScript string constants are parsed by the JavaScript parser. Text inside HTML tags is parsed by the HTML parser. The two languages (and, by extension, their parsers) are different, and in particular they have different ways of representing characters by character code.&amp;rdquo; Basically they won&amp;rsquo;t have issue with different character encoding as they would render same character. More over javascript parser would parse the character into the html when you use innerHTML method.&lt;/p&gt;</description></item></channel></rss>