-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathresolutionsettings.html
98 lines (79 loc) · 2.97 KB
/
resolutionsettings.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!--
If not stated otherwise in this file or this component's LICENSE file the
following copyright and licenses apply:
Copyright 2017 RDK Management
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<!DOCTYPE html>
<html>
<body bgcolor="white" onload="load()">
<h1>Display Settings Service</h1>
<p id="demo">Status</p>
<a onkeypress="getCurrentResolutionFunction(event)" href="javascript:void(0)" id="getCurrentResolutionLink">Get Resolution</a><br/>
<a onkeypress="setResolution480Function()" href="javascript:void(0);">Set Video Resolution to 480</a><br/>
<a onkeypress="setResolution1080Function()" href="javascript:void(0);">Set Video Resolution to 1080</a><br/>
<script type="text/javascript">
$("#demo").focus();
function onResolutionChanged(videoDisplay, resolution)
{
document.getElementById("demo").innerHTML="The resolution has been changed to " + resolution;
}
function load()
{
document.getElementById("demo").innerHTML="load called";
var service = ServiceManager.getServiceForJavaScript("org.openrdk.DisplaySettings");
if (service)
{
document.getElementById("demo").innerHTML="service loaded";
}
else
{
document.getElementById("demo").innerHTML="unable to load servcie";
}
document.getElementById('getCurrentResolutionLink').focus();
service.onResolutionChanged.connect(onResolutionChanged);
}
function getCurrentResolutionFunction(event)
{
if (event.keyCode == 32 )
{
var service = ServiceManager.getServiceForJavaScript("org.openrdk.DisplaySettings");
if (service)
{
document.getElementById("demo").innerHTML="The Current Resolution is : " + service.getCurrentResolution("HDMI0");
}
else
{
document.getElementById("demo").innerHTML="service not found";
}
}
}
function setResolution480Function()
{
if (event.keyCode === 32 )
{
var service = ServiceManager.getServiceForJavaScript("org.openrdk.DisplaySettings");
service.setCurrentResolution("HDMI0", "480i");
document.getElementById("demo").innerHTML="Video Resolution set to 480";
}
}
function setResolution1080Function()
{
if (event.keyCode === 32 )
{
var service = ServiceManager.getServiceForJavaScript("org.openrdk.DisplaySettings");
service.setCurrentResolution("HDMI0", "1080p24");
document.getElementById("demo").innerHTML="Vidoe Resolution set to 1080";
}
}
</script>
</body>
</html>