zoukankan      html  css  js  c++  java
  • 视频直播

    <!DOCTYPE html>
    <htmllang="en">
    <head>
    <metacharset="UTF-8">
    <metaname="viewport"content="width=device-width, initial-scale=1.0">
    <metahttp-equiv="X-UA-Compatible"content="ie=edge">
    <title>直播</title>
    </head>
    <body>
    <imgid="receiver"style="1000px;height:600px"/>
    </body>
    <scripttype="text/javascript"charset="utf-8">
    //创建一个socket实例
    var receiver_socket = new WebSocket("ws://172.16.151.190:7890");
    var image = document.getElementById('receiver');
    // 监听消息
    receiver_socket.onmessage = function(data)
    {
    image.src=data.data;
    }
    </script>
    </html>
    <!DOCTYPE html>
    <htmllang="en">
    <head>
    <metacharset="UTF-8">
    <metaname="viewport"content="width=device-width, initial-scale=1.0">
    <metahttp-equiv="X-UA-Compatible"content="ie=edge">
    <title>直播</title>
    </head>
    <body>
    <imgid="receiver"style="1000px;height:600px"/>
    </body>
    <scripttype="text/javascript"charset="utf-8">
    //创建一个socket实例
    var receiver_socket = new WebSocket("ws://172.16.151.190:7890");
    var image = document.getElementById('receiver');
    // 监听消息
    receiver_socket.onmessage = function(data)
    {
    image.src=data.data;
    }
    </script>
    </html>
  • 相关阅读:
    js字符串函数
    js流程语句
    js数组
    js变量
    js运算符
    Time.deltaTime和Time.realtimeSinceStartup
    Prefabs实例化 ResourceMgr
    SLua
    判断物体是否在摄像机内
    [Unity3D]引擎崩溃、异常、警告、BUG与提示总结及解决方法
  • 原文地址:https://www.cnblogs.com/benmumu/p/10757997.html
Copyright © 2011-2022 走看看