rtc-live.html 990 B

123456789101112131415161718192021222324252627282930313233343536
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  6. <title></title>
  7. <script src="./js/socket.io.min.js"></script>
  8. </head>
  9. <body>
  10. <script>
  11. var socket = io("http://127.0.0.1:10010", {
  12. transports:['websocket'],
  13. path: "/im-rtc",
  14. query: {
  15. userName:'张三'
  16. },
  17. })
  18. socket.on('connect',function(){
  19. setInterval(() => {
  20. socket.emit('muted',true,"213132")
  21. }, 3000);
  22. })
  23. socket.on('join',function(data){
  24. console.log(location.hash)
  25. location.hash.substr()
  26. })
  27. socket.on('muted',function(){
  28. console.log(arguments)
  29. })
  30. </script>
  31. </body>
  32. </html>