<?xml version='1.0' encoding="utf-8"?>
      <rss version='2.0'>
      <channel>
      <title>Форум на Исходниках.RU</title>
      <link>https://forum.sources.ru</link>
      <description>Форум на Исходниках.RU</description>
      <generator>Форум на Исходниках.RU</generator>
  	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=449823&amp;view=findpost&amp;p=3925977</guid>
        <pubDate>Thu, 24 Jul 2025 13:31:40 +0000</pubDate>
        <title>Контроль выбора эпизода</title>
        <link>https://forum.sources.ru/index.php?showtopic=449823&amp;view=findpost&amp;p=3925977</link>
        <description><![CDATA[cupoma58: Получилось не очень но - работает:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">progres.addEventListener(&#39;mousemove&#39;, (e) =&#62; {</div><div class="code_line">&nbsp;&nbsp; &nbsp;if (video.paused || video.ended) { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// условия пред-просмотра</div><div class="code_line">&nbsp;&nbsp; &nbsp;progres.focus(); &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;var rect = progres.getBoundingClientRect(),</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;posX = e.clientX - rect.left, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;perc = posX / rect.width, &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;time = perc * video.duration; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;if (isFinite(time) &amp;&amp; !isNaN(time) &amp;&amp; time &#62;= 0)) {</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;video.currentTime = time; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">&nbsp;&nbsp; &nbsp;}</div><div class="code_line">});</div><div class="code_line">&nbsp;</div><div class="code_line">progres.addEventListener(&#39;click&#39;, () =&#62; {</div><div class="code_line">&nbsp;&nbsp; &nbsp;video.play(); &nbsp; </div><div class="code_line">});</div></ol></div></div></div></div><script>preloadCodeButtons('1');</script><br>
Без canvas, как-то, обошлось.]]></description>
        <author>cupoma58</author>
        <category>Lisp</category>
      </item>
	
      <item>
        <guid isPermaLink='true'>https://forum.sources.ru/index.php?showtopic=449823&amp;view=findpost&amp;p=3909168</guid>
        <pubDate>Tue, 27 Aug 2024 08:03:58 +0000</pubDate>
        <title>Контроль выбора эпизода</title>
        <link>https://forum.sources.ru/index.php?showtopic=449823&amp;view=findpost&amp;p=3909168</link>
        <description><![CDATA[cupoma58: Есть рабочий медиа-плеер, под Chrome, с выбором времени просмотра:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">choise.addEventListener(&#39;mousemove&#39;, (e) =&#62; {</div><div class="code_line">&nbsp;&nbsp; &nbsp;var skipTo = Math.round((e.offsetX / e.target.clientWidth) * parseInt(e.target.getAttribute(&#39;max&#39;), 10));</div><div class="code_line">&nbsp;&nbsp; &nbsp;choise.setAttribute(&#39;data-seek&#39;, skipTo); </div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;choiseBar.innerHTML = setTime(skipTo); &nbsp;// таймер, в окошке</div><div class="code_line">&nbsp;&nbsp; &nbsp;//choiseBar.getContext(&#39;2d&#39;).drawImage(video,0,0,80,45) // это - не то (если &#60;canvas id=&quot;choise-bar&quot;...) </div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp;var rect = video.getBoundingClientRect();</div><div class="code_line">&nbsp;&nbsp; &nbsp;choiseBar.style.left = `${e.pageX - rect.left}px`;</div><div class="code_line">});</div></ol></div></div></div></div><br>
Это - окошко:<br>
<div class='tag-code'><span class='pre_code'></span><div class='code  code_collapsed ' title='Подсветка синтаксиса доступна зарегистрированным участникам Форума.' style=''><div><div><ol type="1"><div class="code_line">.choise-bar{ </div><div class="code_line">&nbsp;&nbsp; &nbsp;position: absolute;</div><div class="code_line">&nbsp;&nbsp; &nbsp;bottom: 10px;</div><div class="code_line">&nbsp;&nbsp; &nbsp;margin-left: -60px; </div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;display: none; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;content: attr(data-title);</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;width: 80px;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;height: 45px;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;border: 1px solid #646464;</div><div class="code_line">&nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;font-size:11px; &nbsp;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;padding:3px;</div><div class="code_line">&nbsp;&nbsp; &nbsp; &nbsp;color:#ffb90f;</div><div class="code_line">&nbsp;&nbsp; &nbsp;background: transparent; </div><div class="code_line">}</div></ol></div></div></div></div><br>
Хочу поменять таймер - на картинку-кадр, из видео-файла.<br>
Через Canvas - не получается.<br>
Где искать?]]></description>
        <author>cupoma58</author>
        <category>Lisp</category>
      </item>
	
      </channel>
      </rss>
	