我决定学习 WebRTC,但不展示视频。请帮忙。我究竟做错了什么?使用 Chrome 我的代码:
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<script>
window.onload = function () {
navigator.webkitGetUserMedia({ video: true }, getStream, noStream);
};
function getStream(stream) {
var url = window.webkitURL.createObjectURL(stream);
var video = document.getElementById('video');
video.src = url;
}
function noStream(faild) {
}
</script>
<video id="video" autoplay="autoplay" width="400"></video>
</body>
</html>
Run Code Online (Sandbox Code Playgroud) 我将Grid与SwipeGesture和ScrollView一起使用。ScrollView可以很好地工作,但是SwipeGesture不能仅在Android上工作。在iOS中,我没有问题。
为什么?请帮帮我
<Grid x:Name="grid">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<ScrollView HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
...
</ScrollView>
</Grid>
Run Code Online (Sandbox Code Playgroud)
C#:
var leftSwipeGesture = new SwipeGestureRecognizer { Direction = SwipeDirection.Right };
leftSwipeGesture.Threshold = 50;
leftSwipeGesture.Swiped += (sender, e) => Navigation.PopAsync();
grid.GestureRecognizers.Add(leftSwipeGesture);
Run Code Online (Sandbox Code Playgroud)