Skip to content

Instantly share code, notes, and snippets.

@rominf
Created April 25, 2019 12:21
Show Gist options
  • Save rominf/942f08158affdfde3dd490d196ec7eec to your computer and use it in GitHub Desktop.
Save rominf/942f08158affdfde3dd490d196ec7eec to your computer and use it in GitHub Desktop.
CameraSelectionPage.qml
ScrollView {
anchors.fill: context;
ListView {
anchors.fill: parent;
spacing: 10;
model: ListModel {
id: camerasModel;
}
delegate: Rectangle {
color: "#6fda9c";
width: 500;
height: 50;
Text {
anchors.centerIn: parent;
text: model.text;
color: "white";
}
ClickMixin { }
onClicked: {
mediaserverClient.instance.authDigest()
.then((auth) => {
var cameraId = model.id.replace(/[{}]/, '');
cameraVideoPlayer.source = mediaserverClient.instance.url.path('/media/' + cameraId + '.webm').query({'auth': auth});
pages.currentIndex = 2;
})
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment