提交 d6e5bb7a authored 作者: Anthony Minessale's avatar Anthony Minessale 提交者: Michael Jerris

FS-7509: update verto js for local video

上级 4d100bc2
...@@ -120,8 +120,20 @@ ...@@ -120,8 +120,20 @@
<!-- <button data-inline="true" class="startxferbtn">Transfer</button>--> <!-- <button data-inline="true" class="startxferbtn">Transfer</button>-->
<br><br> <br><br>
<img src="img/verto_black_web.gif" width="300"><br><br> <img src="img/verto_black_web.gif" width="300"><br><br>
<div id="media"> <div id="media">
<video id="webcam" autoplay="autoplay" hidden="true"></video>
<button data-inline="true" id="smallerbtn">Smaller - </button>
<button data-inline="true" id="biggerbtn">Bigger +</button>
<button data-inline="true" id="fullbtn">Full Screen</button>
<table border=1 cellspacing=0 cellpadding=0 width=95%><tr>
<td valign=top align=center><video id="webcam" autoplay="autoplay"></video></td>
</tr><tr>
<td valign=top align=left><video id="local_webcam" autoplay="autoplay" style="transform: scale(-1, 1);webkit-transform: scale(-1, 1);"></video></td>
</tr></table>
</div> </div>
......
This diff was suppressed by a .gitattributes entry.
...@@ -9,6 +9,9 @@ var chatting_with = false; ...@@ -9,6 +9,9 @@ var chatting_with = false;
var vid_width = 320; var vid_width = 320;
var vid_height = 180; var vid_height = 180;
var local_vid_width = 320;
var local_vid_height = 180;
$( ".selector" ).pagecontainer({ "theme": "a" }); $( ".selector" ).pagecontainer({ "theme": "a" });
...@@ -75,30 +78,91 @@ function setupChat() { ...@@ -75,30 +78,91 @@ function setupChat() {
} }
function full_screen(name) {
var elem = document.getElementById(name);
if (!elem) return;
if (elem.requestFullscreen) {
elem.requestFullscreen();
} else if (elem.msRequestFullscreen) {
elem.msRequestFullscreen();
} else if (elem.mozRequestFullScreen) {
elem.mozRequestFullScreen();
} else if (elem.webkitRequestFullscreen) {
elem.webkitRequestFullscreen();
}
}
$("#webcam").resize(function(e) {
console.log("video size changed to " + $("#webcam").width() + "x" + $("#webcam").height());
if ($("#webcam").width() > $(window).width()) {
//resize(false);
$("#webcam").width("100%");
$("#webcam").height("100%");
}
});
function resize(up) {
var width = $("#webcam").width();
var height = $("#webcam").height();
if (up) {
$("#webcam").width(width * 1.20);
$("#webcam").height(height * 1.20);
} else {
$("#webcam").width(width * .80);
$("#webcam").height(height * .80);
}
console.log("video size changed to " + $("#webcam").width() + "x" + $("#webcam").height());
}
function real_size() {
$("#webcam").width("");
$("#webcam").height("");
console.log("video size changed to natural default");
}
function check_vid_res() function check_vid_res()
{ {
if ($("#vqual_qvga").is(':checked')) { if ($("#vqual_qvga").is(':checked')) {
vid_width = 320; vid_width = 320;
vid_height = 240; vid_height = 240;
local_vid_width = 160;
local_vid_height = 120;
} else if ($("#vqual_vga").is(':checked')) { } else if ($("#vqual_vga").is(':checked')) {
vid_width = 640; vid_width = 640;
vid_height = 480; vid_height = 480;
local_vid_width = 160;
local_vid_height = 120;
} else if ($("#vqual_hd").is(':checked')) { } else if ($("#vqual_hd").is(':checked')) {
vid_width = 1280; vid_width = 1280;
vid_height = 720; vid_height = 720;
local_vid_width = 320;
local_vid_height = 180;
} else if ($("#vqual_hhd").is(':checked')) { } else if ($("#vqual_hhd").is(':checked')) {
vid_width = 1920; vid_width = 1920;
vid_height = 1080; vid_height = 1080;
local_vid_width = 320;
local_vid_height = 180;
} }
$("#webcam").width(vid_width); $("#local_webcam").width(local_vid_width);
$("#webcam").height(vid_height); $("#local_webcam").height(local_vid_height);
real_size();
if (verto) { if (verto) {
verto.videoParams({"minWidth": vid_width, verto.videoParams({
"minWidth": vid_width,
"minHeight": vid_height, "minHeight": vid_height,
"maxWidth": vid_width,
"maxHeight": vid_height,
"minFrameRate": 30, "minFrameRate": 30,
//chromeMediaSource: 'screen', //chromeMediaSource: 'screen',
//mediaSource: 'screen' //mediaSource: 'screen'
...@@ -304,7 +368,7 @@ var callbacks = { ...@@ -304,7 +368,7 @@ var callbacks = {
case $.verto.enum.state.destroy: case $.verto.enum.state.destroy:
$("#hangup_cause").html(""); $("#hangup_cause").html("");
clearConfMan(); clearConfMan();
real_size();
cur_call = null; cur_call = null;
break; break;
case $.verto.enum.state.held: case $.verto.enum.state.held:
...@@ -403,6 +467,18 @@ $("#hupbtn").click(function() { ...@@ -403,6 +467,18 @@ $("#hupbtn").click(function() {
cur_call = null; cur_call = null;
}); });
$("#fullbtn").click(function() {
full_screen("webcam");
});
$("#biggerbtn").click(function() {
resize(true);
});
$("#smallerbtn").click(function() {
resize(false);
});
$("#webcam").click(function() { $("#webcam").click(function() {
check_vid(); check_vid();
}); });
...@@ -556,12 +632,11 @@ function init() { ...@@ -556,12 +632,11 @@ function init() {
passwd: $("#passwd").val(), passwd: $("#passwd").val(),
socketUrl: $("#wsURL").val(), socketUrl: $("#wsURL").val(),
tag: "webcam", tag: "webcam",
localTag: "local_webcam",
ringFile: "sounds/bell_ring2.wav", ringFile: "sounds/bell_ring2.wav",
videoParams: { videoParams: {
"minWidth": vid_width, "minWidth": vid_width,
"minHeight": vid_height, "minHeight": vid_height,
"maxWidth": vid_width,
"maxHeight": vid_height,
"minFrameRate": 30, "minFrameRate": 30,
//chromeMediaSource: 'screen', //chromeMediaSource: 'screen',
//mediaSource: 'screen' //mediaSource: 'screen'
...@@ -605,7 +680,7 @@ function init() { ...@@ -605,7 +680,7 @@ function init() {
}); });
$("#xferdiv").hide(); $("#xferdiv").hide();
$("#webcam").hide(); // $("#webcam").hide();
online(false); online(false);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论