1、页面名称:sentenceReadRecordDialogAnyone.jsp

2、页面效果

3、页面源码

<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%><script language="javascript" type="text/javascript" src="<c:url value='/scripts/course/sentenceReadRecordDialog.js'/>"></script><script type="text/javascript" charset="UTF-8">var RANK_PRIMARY = 1;//初级的
var RANK_MIDDLE = 2;//中级的
var RANK_ADVANCED = 3;//高级的var _wordReadRecordVoArray = JSON.parse('${wordReadRecordVoListJson }');
var wordRecordDialog = null;
var _rank = parseInt("${rank}");
var _starCount = parseInt("${starCount}");$(document).ready(function() {if (_starCount > 0) {$("#scoreStarPlus").show();setTimeout(function(){$("#scoreStarPlus").fadeOut(1500);}, 1000);}//加载录音代码if ($("#aVoiceRecordFlash").length <= 0) {$.ajax({url: "<c:url value='/course/loadRecordCode.action'/>",type: "GET",success: function(response) {$("body").append(response);}});}//收藏按钮状态初始化var collected = "${sentenceVo.collected }";if(collected && collected == "true") {$("#sentence_collected").show();$("#sentence_uncollected").hide();}//句子状态行为初始化$.initSentenceContent = function(){$("#sentence_content").find("span[type='word']").each(function(){var score = $(this).attr("score");var word = $(this).text().trim();var wordId = $(this).attr("id");if (_rank == RANK_ADVANCED) {if (score >= 0) {$(this).attr("title", "得分:" + score);} else {$(this).attr("title", "未识别");}}$(this).css("cursor","pointer");//低分单词变色if(score && score < 0) {$(this).addClass("font-color-bad");}//添加单词点击事件 $(this).click(function(){$.showWordReadRecordDialog(wordId, word);});});};$.initSentenceContent();//单词打分结果对话框 index单词在句子中的索引,word单词内容$.showWordReadRecordDialog = function(wordId, wordContent){//根据wordId获取到对应的wordRecordJsonvar wordReadRecordVoJson = "{}";for (var i in _wordReadRecordVoArray) {if (wordId == _wordReadRecordVoArray[i].wordId) {wordReadRecordVoJson = JSON.stringify(_wordReadRecordVoArray[i]);break;}}// 初始化一个带有loading图标的空对话框if (!wordRecordDialog) {wordRecordDialog = art.dialog({id: "wordRecordDialog",fixed: true,close:function(){wordRecordDialog = null;return true;}});}var requestUrl = "<c:url value='/course/loadWordReadRecordDialog.action'/>";$.ajax({url: requestUrl,data: "wordReadRecordVoJson=" + encodeURIComponent(wordReadRecordVoJson) + "&wordContent=" + wordContent + "&sentenceReadVoiceId=${sentenceReadRecordVo.readVoiceId }&sentenceId=${sentenceId}",type: "GET",cache: false,success: function(response) {if(wordRecordDialog != null) {wordRecordDialog.content(response);var wordDialogTop = '${wordDialogTop == null ? "230" : wordDialogTop}';try {if(top.art.dialog.data("leftPos")){var leftPos = top.art.dialog.data("leftPos"); wordRecordDialog.position(leftPos, wordDialogTop + "px");}else{wordRecordDialog.position("50%", wordDialogTop + "px");}} catch (e) {wordRecordDialog.position("50%", wordDialogTop + "px");}}}});};//中文翻译按钮事件$("#translation_btn").click(function(){if ($(this).hasClass("eng")) {if ($("#sentence_content_karaoke").find("c:first").attr("class")) {$("#sentence_content").hide();$("#sentence_content_karaoke").show();} else {$("#sentence_content").show();$("#sentence_content_karaoke").hide();}$("#sentence_content_trans").hide();$(this).removeClass("eng");$(this).attr("title", "查看翻译");} else {$("#sentence_content").hide();$("#sentence_content_karaoke").hide();$("#sentence_content_trans").show();$(this).addClass("eng");$(this).attr("title", "查看原文");}});//收藏按钮事件$("#sentence_collected").click(function(){$.ajax({url: "<c:url value='/base/sentenceCollectOrNot.action?isCollected=true&sentenceId='/>${sentenceVo.id }",type: "POST",dataType: "json",success: function(response){if(response && response.message) {//成功$("#sentence_collected").hide();$("#sentence_uncollected").show();}}});});//未收藏按钮事件$("#sentence_uncollected").click(function(){$.ajax({url: "<c:url value='/base/sentenceCollectOrNot.action?isCollected=false&sentenceId='/>${sentenceVo.id }",type: "POST",dataType: "json",success: function(response){if(response && response.message) {//成功$("#sentence_collected").show();$("#sentence_uncollected").hide();}}});});//跟读练习$("#sentence_listen_and_record_btn").click(function(){//停止播放srrd.thisMovie("sentenceMp3Player").stopAudio();srrd.karaokePlayStop();if (wordRecordDialog != null) {wordRecordDialog.close();}$("#scoreResultImg").hide();$("#scoreResultDescription").hide();var content = $("#sentence_content").text().trim();$.aShowVoiceRecordDialog(content, function(voiceId,recordDuringTime){if (voiceId) {$.ajax({url: "<c:url value='/course/gradeVoiceRecordAnyone.action'/>",data: "sentenceId=${sentenceId }&voiceRecordId=" + voiceId+"&gradeReturnType=json&recordDuringTime="+recordDuringTime,type: "POST",dataType: "json",success: function(response){if (response.message.success) {//句子录音打分成功_wordReadRecordVoArray = response.message.sentenceReadRecordVo.wordReadRecordVoList;var score = response.message.sentenceReadRecordVo.score;var imgSrc = "<c:url value='/images/face-sad3.png'/>";var imgDes = "还要继续加油哦~";if (score > 0) {imgSrc = "<c:url value='/images/face-smile3.png'/>";imgDes = "嗯,很不错啦,加油";}$("#scoreResultImg").attr("src", imgSrc);$("#scoreResultDescription").text(imgDes);$("#play_sentence_record_btn").attr("voiceId", voiceId);$("#sentence_content").html(response.message.sentenceReadRecordVo.html);$.initSentenceContent();//如果是中文翻译状态,切换成英文if ($("#translation_btn").hasClass("eng")) {$("#translation_btn").trigger("click");}//显示增加智慧星if (response.message.starCount > 0) {$("#scoreStarPlus").children("span").text(response.message.starCount);$("#scoreStarPlus").show();//2014年5月6日修改bug817/*setTimeout(function(){$("#scoreStarPlus").fadeOut(1500);}, 1000);*/}}//关闭录音对话框closeVoiceRecordDialog();},error: function(){closeVoiceRecordDialog();}});} else {//关闭录音对话框closeVoiceRecordDialog();}}, function(){$("#scoreResultImg").show();$("#scoreResultDescription").show();});});//播放句子录音 $("#play_sentence_record_btn").click(function(){var voiceId = $(this).attr("voiceId");var sentenceRecordAudioUrl = "record/" + voiceId + ".flv";srrd.thisMovie("sentenceMp3Player").loadAndPlayAudio(sentenceRecordAudioUrl);});//播放句子标准音频$("#play_sentence_original_btn").click(function(){if(!$("#sentence_content_karaoke").text().trim()){var content = $("#sentence_content").text().trim();content = srrd.getSplitSentence(content);$("#sentence_content_karaoke").html(content);}//隐藏原始内容,显示卡拉ok效果内容$("#sentence_content").hide();$("#sentence_content_trans").hide();$("#sentence_content_karaoke").show();//音频开始和结束时间srrd.audioStartTime = "${sentenceVo.audioStartTime }".trim();srrd.audioEndTime = "${sentenceVo.audioEndTime }".trim();if (srrd.audioStartTime == "") {srrd.audioStartTime = 0;}if (srrd.audioEndTime == "") {srrd.audioEndTime = 0;}srrd.audioStartTime *= 1000;srrd.audioEndTime *= 1000;//卡拉ok持续时间,全局变量srrd.karaokeDuration = srrd.audioEndTime - srrd.audioStartTime;var sentenceAudioUrl = "audio/${sentenceVo.standardPronunciation }.mp3";//getSentencePlayerMovie("sentenceMp3Player").loadAndPlayAudio(sentenceAudioUrl, audioStartTime*1000, audioEndTime*1000);srrd.thisMovie("sentenceMp3Player").loadMp3Audio(sentenceAudioUrl, "srrd.onAudioPrepared");});});//音频缓冲完毕
srrd.onAudioPrepared = function(){//检测播放概率性一直持续LOG//top.//console.log("srrd.audioStartTime:" + srrd.audioStartTime + ", srrd.audioEndTime:" + srrd.audioEndTime);//top.//console.log("srrd.karaokeDuration:" + srrd.karaokeDuration);if (srrd.karaokeDuration <= 0) {srrd.karaokeDuration = srrd.thisMovie("sentenceMp3Player").getAudioLength();srrd.thisMovie("sentenceMp3Player").playAudio();} else {srrd.thisMovie("sentenceMp3Player").playAudio(srrd.audioStartTime, srrd.audioEndTime);}srrd.karaoke("#sentence_content_karaoke", srrd.karaokeDuration, function(){setTimeout(function(){//隐藏原始内容,显示卡拉ok效果内容$("#sentence_content_karaoke").hide();if ($("#translation_btn").hasClass("eng")) {$("#sentence_content_trans").show();} else {$("#sentence_content").show();}//清除卡拉ok变色效果$("#sentence_content_karaoke").find("c").removeAttr("class");}, 200);});
};function onSentencePlayerLoadCompleted(){var rtmpServerUrl = "${rtmpServerUrl}";srrd.thisMovie("sentenceMp3Player").setRtmpServerURL(rtmpServerUrl);
}</script><!-- 隐藏的ActionScript播放器类   -->
<object style="width: 1px; height: 1px;position:fixed; bottom:0px; left:0px;" type="application/x-shockwave-flash" data="<c:url value='/flash/NetStreamAudioPlayerAS.swf?onLoadCompleted=onSentencePlayerLoadCompleted'/>" name="sentenceMp3Player" id="sentenceMp3Player" ><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="<c:url value='/flash/NetStreamAudioPlayerAS.swf?onLoadCompleted=onSentencePlayerLoadCompleted'/>" /><param name="visible" value="false" />
</object><div style="width: 500px;">
<table style="height:45px; margin-bottom: 2px;margin-top: 0;position: relative;top: -10px;"><tr><td style="width: 90px;padding-left: 0;"><!-- ${sentenceReadRecordVo.score } --><span class="font-18 font-black">跟读反馈:</span></td><td style="width: 40px;"><img id="scoreResultImg" width="30px" height="30px" src="<c:url value='/images/'/>${sentenceReadRecordVo.faceImgName }"/></td><td align="right" style="text-align: left;"><span id="scoreResultDescription" class="font-12 font-orange">${sentenceReadRecordVo.description }</span><span id="scoreStarPlus" class="font-12 font-orange" style="display: none;">智慧星 +<span>${starCount}</span></span></td></tr>
</table>
<div class="hr-long-orange" style="position: relative;top: -15px;"></div><!-- 句子内容  -->
<div style="line-height: 1.4; margin-bottom: 30px;"><span id="sentence_content" class="font-18 font-black" style="display:block; width: 100%;">${sentenceReadRecordVo.html }</span><span id="sentence_content_karaoke" class="font-18 font-black" style="display: none;"></span><span id="sentence_content_trans" class="font-18 font-black" style="display: none;">${sentenceVo.translation }</span>
</div><div style="position: absolute; bottom: 15px; width: 500px;"><!-- 下角图标 --><div style="float: right;"><input id="play_sentence_original_btn" class="icon-button speaker" type="button" title="听原音" /><input id="play_sentence_record_btn" class="icon-button headset" type="button" voiceId="${sentenceReadRecordVo.readVoiceId }" title="听录音" /><input id="sentence_listen_and_record_btn" class="icon-button mic" type="button" title="跟读" /><input id="translation_btn" class="icon-button chn" type="button" title="查看翻译" /><input id="sentence_collected" class="icon-button favorited" type="button" title="取消收藏" style="display: none;"/><input id="sentence_uncollected" class="icon-button favorite" type="button" title="收藏" style="display: ${empty currentUserId?'none':''}"/></div>
</div>
</div>

句子录音打分代码参考相关推荐

  1. php透明颜色的代码,PHP 透明水印生成代码参考

    PHP 透明水印生成代码参考 复制代码 代码如下: /* * Created on 2010-10-27 * BY QQ542900563 * Copyrights Reserved 2000-202 ...

  2. 假导出Excel功能实现,按CSV格式快速导出功能代码参考(追求代码追求简洁复用)...

    我们辛苦录入的数据都希望能有重复利用的价值,一方面这些基础数据需要有数据库级的重复利用,程序级别的重复利用,另一方面还需要直接可以方便的导出倒入的功能比较好,虽然我们自己制作的统计分析功能很强大,但是 ...

  3. proto—go语言生成代码参考(Generated-code reference中文翻译)

      对go语言生成代码参考页面进行了翻译(大部分是google翻译做的,人工润色了一下),加深对gRPC的理解,方便以后复习. Generated-code reference(中文翻译)   此页面 ...

  4. C++ 简化 推箱子 小游戏 完整代码 参考网络资料 命令行运行 仅供初学者参考交流

    C++ 简化 推箱子 小游戏 完整代码 参考网络资料 命令行运行 仅供初学者参考交流 说明:学做了4关推箱子, 仅供初学者参考可用g++ 编译,可以将内容复制到TXT文件,将后缀改为".cp ...

  5. dede织梦内容管理系统模板标签代码参考

    ◆织梦内容管理系统模板标签代码参考 [Arclist 标记] 这个标记是DedeCms最常用的一个标记,也叫自由列表标记,其中 hotart.coolart.likeart.artlist.imgli ...

  6. 蓝桥杯历届试题代码参考

    蓝桥杯历届试题代码参考 历届试题 核桃的数量 打印十字图 带分数 剪格子 错误票据 翻硬币 连号区间数 买不到的数目 大臣的旅费 幸运数 横向打印二叉树 危险系数 网络寻路 高僧斗法 格子刷油漆 农场 ...

  7. 用C++写的一段电话录音程序代码

    用C++写的一段电话录音程序代码 //--------------------------------------------------------------------------- #incl ...

  8. html5视频画质清晰度切换和倍速播放切换代码参考

    阿酷TONY  / 原创 / 2022-11-10  /  长沙  / 2022-11-11 / html5视频播放器如何实现[视频画质清晰度切换]和[倍速播放切换]? html5视频画质清晰度切换切 ...

  9. 毕业论文 [ 1 ]:查找论文代码参考

    查找论文代码参考 1. 文章源码 2. arXiv源码 3. Chrome插件:Find Code for Research Papers 附参考: 1. 文章源码   直接查找文章发布的源地址,查看 ...

最新文章

  1. ubuntu 14.04如何设置静态IP
  2. fedora下重用ssh连接 类似secureCRT的clone session功能
  3. python语言中文社区-Python 之父谈 Python-Go语言中文社区
  4. 操作系统的安装与启动基本原理
  5. 在win10下安装自带的linux,并进行相应的配置
  6. Python基础day01【软件安装、变量的定义和使用、数据类型、标识符和关键字、输入输出、数据类型转换、运算符、PEP 8 规范】
  7. 1.18.2.10 解释表:Table.explain、物理执行计划等
  8. 【已解决】Error: Module not specified (IntelliJ IDEA)
  9. flask框架中勾子函数的使用
  10. [最短路/线段树大法优化DIJ] 【模板】单源最短路径(标准版)
  11. 【今日CV 计算机视觉论文速览 第125期】Wed, 5 Jun 2019
  12. java 不存在就创建,java怎么实现判断文件是否存在,不存在就创建的方法
  13. 【论文笔记】命名实体识别论文
  14. vue+vue-cli2+webpack配置资源cdn
  15. Linux 常用的zip压缩和解压命令详解
  16. 有赞宣布收费,免费模式在移动电商时代真走不通?
  17. 我的世界学园都市java_我的世界学园都市地图整合包
  18. 软考常考的四种设计模式
  19. string中back函数和pop-back函数意思
  20. Unity中的矩阵Matrix

热门文章

  1. Android系统原生应用解析之桌面闹钟及相关原理应用之时钟任务的应用(一)
  2. day-17 包与模块
  3. 批量替换文件夹下所有文件的内容
  4. KnockoutJS-与服务端交互
  5. 数据结构开发(3):线性表的顺序存储结构
  6. python函数:基础函数调用整理
  7. python FOR循环
  8. python--17个新手常见Python运行时错误
  9. 第一节《Git初始化》
  10. 3月任务--target