如果直接转到页面(/ stream),视频就可以正常工作,但如果通过ng-view加载该页面,视频将无法加载,我不确定是什么问题。
在index.html中:
<a href="#stream">stream</a
<div ng-view></div>
在stream.html中:
<style>
video {
width: 250px;
height: 150px;
}
</style>
<nav class="row">
<div class="col-xs-6 col-md-1">
</div>
<div class="col-xs-6 col-md-2">
<a href ng-click = "controller.setVideo(0)">
<div style="text-align:center">stream 1</div>
<video data-dashjs-player autoplay src="http://localhost:1935/test/test1.stream/manifest.mpd" muted></video>
</a>
</div>
<div class="col-xs-6 col-md-2">
<a href ng-click = "controller.setVideo(1)">
<div style="text-align:center">stream 2</div>
<video data-dashjs-player autoplay src="http://vm2.dashif.org/livesim/testpic_2s/Manifest.mpd" muted></video>
</a>
</div>
</nav>
在app.js中:
App.config(function($routeProvider) {
$routeProvider
.when("/", {
templateUrl : "main.html"
})
.when("/stream", {
templateUrl : "stream.html"
});
});