浏览代码

Title now changes after song name and artist

:trollface: And some speak stuff
johand199 9 年之前
父节点
当前提交
e2ec8acfcb
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      app/client/scripts/onCreated.js

+ 3 - 0
app/client/scripts/onCreated.js

@@ -188,6 +188,9 @@ Template.room.onCreated(function () {
         var d = moment.duration(parseInt(songData.duration), 'seconds');
         $("#time-total").text(d.minutes() + ":" + ("0" + d.seconds()).slice(-2));
         Session.set("timeFormat", d.minutes() + ":" + ("0" + d.seconds()).slice(-2));
+        document.title = Session.get("title") + " - " + Session.get("artist") + " - Musare"
+        var msg = new SpeechSynthesisUtterance("New song:" + Session.get("title") + " By: " + Session.get("artist"));
+        window.speechSynthesis.speak(msg);
     }
 
     function resizeSeekerbar() {