欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

海康威视播放功能代码缩减版 博客分类: 监控 海康威视HTML监控

程序员文章站 2024-03-17 12:25:34
...

 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title></title>
</head>
<body>
<object classid="clsid:5A418331-514E-4C54-B526-6AC3C135FFD2" codebase="" standby="Waiting..."
        id="NetVideoActiveX"
        width="100%" height="95%" name="ocx" align="center">
</object>
<script type="text/javascript">
    var m_userinfo = '192.168.5.235 admin 12345 8000';      //从服务器获取当前注册用户信息
    var TOP_WINDOW = 0;
    window.onload = (function () {
        var player = document.getElementById("NetVideoActiveX");
        var parts = m_userinfo.split(' ');
        var serverIpAddress = parts[0];
        var serverPort = parseInt(parts[3]);
        var username = parts[1];
        var password = parts[2];
        var tokenId = player.Login(serverIpAddress, serverPort, username, password);
        if (tokenId == -1) {
            alert('不能连接');
            return;
        }
        var channel = 0;
        player.StartRealPlay(channel, TOP_WINDOW)

    });
</script>

</body>
</html>