Bladeren bron

Make the sizing/resolution of the canvas a bit clearer; see #16

Dominic Szablewski 11 jaren geleden
bovenliggende
commit
3523b9a8f5
1 gewijzigde bestanden met toevoegingen van 12 en 2 verwijderingen
  1. 12 2
      stream-example.html

+ 12 - 2
stream-example.html Bestand weergeven

@@ -8,10 +8,20 @@
8 8
 			background: #333;
9 9
 			text-align: center;
10 10
 			margin-top: 10%;
11
-		}	
11
+		}
12
+		#videoCanvas {
13
+			/* Always stretch the canvas to 640x480, regardless of its
14
+			internal size. */
15
+			width: 640px;
16
+			height: 480px;
17
+		}
12 18
 	</style>
13 19
 </head>
14
-<body>		
20
+<body>
21
+	<!-- The Canvas size specified here is the "initial" internal resolution. jsmpeg will
22
+		change this internal resolution to whatever the source provides. The size the
23
+		canvas is displayed on the website is dictated by the CSS style.
24
+	-->
15 25
 	<canvas id="videoCanvas" width="640" height="480">
16 26
 		<p>
17 27
 			Please use a browser that supports the Canvas Element, like