Skip to content

Commit

Permalink
修复频率直方图bug。 测试demo添加视频播放测试 xiangyuecn#84
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangyuecn committed May 22, 2020
1 parent a1c7f5b commit 764c992
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
Binary file added assets/audio/movie-sexy-rabbit-baby.mp4
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/extensions/frequency.histogram.view.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,17 @@
Audio对录音的影响测试(<a href="https://github.com/xiangyuecn/Recorder/issues/34">issues#34</a>);IOS Safari如果未开始过录音并且播放了音乐,然后后续录音将会有问题;再现方法(<a href="https://xiangyuecn.github.io/Recorder/assets/ztest_apple_developer_forums_getusermedia.html">test apple developer forums</a>):刷新页面后首先先播放音乐,然后开始测试录音,会发现波形显示掉帧或者保持直线。另测试浏览器对音频的支持情况。
</div>

<div class="mainBox">
<span class="lb">视频播放测试 :</span>
<button onclick="$('.videoTest').show().html('<video controls src=\'assets/audio/movie-sexy-rabbit-baby.mp4\' style=\'width:240px;height:160px\'></'+'video>').find('video')[0].play()">播放mp4</button>

Video对录音的影响测试(<a href="https://github.com/xiangyuecn/Recorder/issues/84">issues#84</a>);IOS Safari可能出现先播放视频,然后再开始录音,会自动播放视频的声音。
<button onclick="$('.videoTest').show()">显示video</button>
<button onclick="$('.videoTest').hide()">隐藏video</button>
<button onclick="$('.videoTest').html('')">移除video</button>
<div class="videoTest"></div>
</div>

<div class="mainBox">
<span class="lb">浏览器环境情况 :</span>
<pre class="recinfoCode">
Expand Down
6 changes: 3 additions & 3 deletions src/extensions/frequency.histogram.view.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,8 @@ fn.prototype=FrequencyHistogramView.prototype={
//绘制柱子
var minHeight=set.minHeight*scale;
var mirrorSubX=spaceFloat+lineWidth/2;
var xFloat=mirrorEnable?width/2-mirrorSubX:0;//镜像时,中间柱子位于正中心
for(var i=0,x,y,h;i<lineCount;i++){
var XFloat=mirrorEnable?width/2-mirrorSubX:0;//镜像时,中间柱子位于正中心
for(var i=0,xFloat=XFloat,x,y,h;i<lineCount;i++){
xFloat+=spaceFloat;
x=Math.floor(xFloat);
h=Math.max(lastH[i],minHeight);
Expand All @@ -294,7 +294,7 @@ fn.prototype=FrequencyHistogramView.prototype={
ctx.shadowBlur=(stripeShadowBlur==-1?set.shadowBlur:stripeShadowBlur)*scale;
ctx.shadowColor=set.stripeShadowColor||set.shadowColor;
var stripeHeight=set.stripeHeight*scale;
for(var i=0,xFloat=0,x,y,h;i<lineCount;i++){
for(var i=0,xFloat=XFloat,x,y,h;i<lineCount;i++){
xFloat+=spaceFloat;
x=Math.floor(xFloat);
h=stripesH[i];
Expand Down

0 comments on commit 764c992

Please sign in to comment.