UE4 PixelStreamingDemo 验证

4.24 和 4.27 的官方案例,照着教程,直接就能跑通,4.26会出各种问题导致无法跑通。

查找了一些资料,最后也跑通了,记录一下4.26的过程。

需要看的两篇:

https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/PixelStreaming/PixelStreamingIntro/icon-default.png?t=M276https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/PixelStreaming/PixelStreamingIntro/https://docs.unrealengine.com/4.27/en-US/Resources/Showcases/PixelStreamingShowcase/icon-default.png?t=M276https://docs.unrealengine.com/4.27/en-US/Resources/Showcases/PixelStreamingShowcase/PixelStreamingDemo 在UE4 Market上面直接下载。

运行时,会报错,解决地址:

UE4.23/4.26像素流插件PixelStreaming使用Chrome访问时的Crash问题 - 知乎UE4.23/4.26像素流插件PixelStreaming使用Chrome浏览器访问时的Crash问题报错提示1:[...PixelStreaming/Private/Streaming.cpp] [Line:173] player 101 not found 报错提示2:信令服务器页面显示:player 102 con…https://zhuanlan.zhihu.com/p/357335311注意评论里信息,很关键:

 这样设置完,localhost能够显示界面,但是PixelDemo.htm依然不能征程,参考Player.htm,修改PixelDemo.htm,就可以了。

webRtcPlayer.js修改内容:

 this.video = createWebRtcVideo();

 this.cfg.offerExtmapAllowMixed = false;

 onsignalingstatechange = function(state) {
    console.info('signaling state change:', state)
 };


// offer.sdp = offer.sdp.replace("useinbandfec=1", "useinbandfec=1;stereo=1;maxaveragebitrate=128000");
  offer.sdp = offer.sdp.replace(/(a=extmap-allow-mixed)\r\n/gm, "");
  pc.setLocalDescription(offer);

PixelDemo.htm 修改可行界面:

<!-- Copyright Epic Games, Inc. All Rights Reserved. -->
<!DOCTYPE HTML>
<html>

<head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/css/bootstrap.min.css"
        integrity="sha384-Smlep5jCw/wG7hdkwQ/Z5nLIefveQRIY9nfy6xoR1uRYBtpZgI6339F5dgvm/e9B" crossorigin="anonymous">
    <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.1.0/css/all.css"
        integrity="sha384-lKuwvrZot6UHsBSfcMvOkWwlCMgc0TaWr+30HWe3a4ltaBwTZhyTEggF5tJv8tbt" crossorigin="anonymous">
    <link type="text/css" rel="stylesheet" href="/player.css">
    <script src="/socket.io/socket.io.js"></script>
    <script type="text/javascript" src="https://webrtc.github.io/adapter/adapter-latest.js"></script>
    <script type="text/javascript" src="/scripts/webRtcPlayer.js"></script>
    <script type="text/javascript" src="/scripts/app.js"></script>
    <script type="text/javascript" src="PixelDemo.js"></script>
    <link type="text/css" rel="stylesheet" href="PixelDemo.css">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!-- For iPhone X the following makes it use the entire screen space for the webpage https://webkit.org/blog/7929/designing-websites-for-iphone-x/ -->
    <meta name='viewport' content='initial-scale=1, viewport-fit=cover'>
</head>

<body onload="load()">
    <nav id="sidebar">
        <ul id="sidebarlist" class="list-unstyled components">
            <li>
                <a href="#charSubmenu" data-toggle="collapse" aria-expanded="false"
                    class="dropdown-toggle">Characters</a>
                <ul class="collapse list-unstyled" id="charSubmenu">
                    <li>
                        <a href="#" onclick="onConfigButton(0,0)"><img src="images/Aurora.png" width="150px" />
                            <h2><span>Aurora</span></h2>
                        </a>
                    </li>
                    <li>
                        <a href="#" onclick="onConfigButton(0,1)"><img src="images/Crunch.png" width="150px" />
                            <h2><span>Crunch</span></h2>
                        </a>
                    </li>
                </ul>
        </ul>
    </nav>

    <div class="wrapper">

        <div id="content" class="container">
            <div id="player"></div>
            <div id="overlay" class="overlay">
                <div>
                    <div id="qualityStatus" class="greyStatus"></div>
                    <div id="overlayButton"></div>
                </div>
            </div>
        </div>
    </div>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
        crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"
        integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49"
        crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.2/js/bootstrap.min.js"
        integrity="sha384-o+RDsa0aLu++PJvFqy8fFScvbHFLtbvScb8AjopnFD+iEQ7wo/CG0xlczd+2O/em"
        crossorigin="anonymous"></script>
</body>

</html>

这样就能跑通了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值