Compare commits
No commits in common. "41189d7f4397d78e01deb5ae97e815e5547801a4" and "8ec53c551b851584ebf65f33ddd01c2faecf0398" have entirely different histories.
41189d7f43
...
8ec53c551b
@ -41,15 +41,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
input[type=text] {
|
||||
width: 100%;
|
||||
padding: 12px 20px;
|
||||
margin: 8px 0;
|
||||
display: inline-block;
|
||||
border: 1px solid #dddddd;
|
||||
border-radius: 4px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
input[type=text],
|
||||
|
||||
select {
|
||||
width: 450px;
|
||||
@ -168,11 +160,6 @@
|
||||
position: relative;
|
||||
top: 1px;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: #333333;
|
||||
color:white;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
@ -42,10 +42,12 @@
|
||||
|
||||
<body bgcolor="#333333">
|
||||
<div id="video-container" onclick="requestSync()">
|
||||
<video id="video" poster="assets/clickToWatch.png" autoplay>
|
||||
<video id="video" poster="assets/clickToWatch.png" controls autoplay>
|
||||
<source id="mp4_src" src=" " type="video/webm">
|
||||
</video>
|
||||
</div>
|
||||
|
||||
<button id="joinInButton" onclick="requestSync()">Join In</button>
|
||||
|
||||
<script>
|
||||
var firstTime = true;
|
||||
@ -80,6 +82,7 @@
|
||||
document.getElementById('video').src = messageData.videoUrl;
|
||||
document.getElementById('video').currentTime = messageData.timeStamp;
|
||||
firstTime = false;
|
||||
document.getElementById("joinInButton").hidden = true;
|
||||
if (!messageData.videoPlaying) {
|
||||
var vid = document.getElementById("video");
|
||||
vid.onloadeddata = function () {
|
||||
@ -111,8 +114,7 @@
|
||||
videoUrl: messageData.videoUrl,
|
||||
length: v.duration,
|
||||
timeStamp: v.currentTime,
|
||||
myTimeStamp: myTimeStamp,
|
||||
aspectRatio: v.videoWidth / v.videoHeight
|
||||
myTimeStamp: myTimeStamp
|
||||
};
|
||||
EventBridge.emitWebEvent(JSON.stringify(readyEvent));
|
||||
clearInterval(videoLoadedSendMessageInterval);
|
||||
@ -124,6 +126,7 @@
|
||||
document.getElementById('video').src = "http://";
|
||||
firstTime = true;
|
||||
HasBeenClicked = false;
|
||||
document.getElementById("joinInButton").hidden = false;
|
||||
} else if (messageData.buttonAction == "volumeButtonMinus") {
|
||||
var video = document.getElementById('video');
|
||||
var volume = video.volume;
|
||||
@ -164,8 +167,6 @@
|
||||
} else if (messageData.action == "videoEnd") {
|
||||
document.getElementById("video").src = "";
|
||||
document.getElementById('video').poster = "assets/clickToWatch.png"
|
||||
} else if (messageData.action == "firstClick") {
|
||||
requestSync();
|
||||
}
|
||||
});
|
||||
|
||||
|
18
videoSync.js
18
videoSync.js
@ -1,10 +1,3 @@
|
||||
// Copyright (c) 2020 Danielle Arlington.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 3.
|
||||
// https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
|
||||
(function () {
|
||||
var tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
|
||||
var videoSyncInterface = Script.resolvePath("assets/videoSyncInterface.html");
|
||||
@ -95,19 +88,10 @@
|
||||
});
|
||||
}
|
||||
_entityID = entityID;
|
||||
Script.addEventHandler(_entityID, "mousePressOnEntity", onFirstClick);
|
||||
Entities.webEventReceived.connect(onWebEvent);
|
||||
addButtons();
|
||||
}
|
||||
|
||||
function onFirstClick() {
|
||||
Entities.emitScriptEvent(_entityID, JSON.stringify({
|
||||
action: "firstClick"
|
||||
}));
|
||||
console.log("onFirstClick");
|
||||
Script.removeEventHandler(_entityID, "mousePressOnEntity", onFirstClick);
|
||||
}
|
||||
|
||||
function onWebEvent(uuid, event) {
|
||||
if (uuid == _entityID || volumeSliderUuid == uuid) {
|
||||
var messageData = JSON.parse(event);
|
||||
@ -291,7 +275,6 @@
|
||||
actOnButtonPressed("pause");
|
||||
break;
|
||||
case leaveButtonUuid:
|
||||
Script.addEventHandler(_entityID, "mousePressOnEntity", onFirstClick);
|
||||
console.log("LeaveButtonUuid Yes");
|
||||
actOnButtonPressed("leave");
|
||||
buttonsAreActive = false;
|
||||
@ -387,7 +370,6 @@
|
||||
Script.removeEventHandler(leaveButtonUuid, "mousePressOnEntity", evaluateWhichButtonPressed);
|
||||
Script.removeEventHandler(pauseButtonUuid, "mousePressOnEntity", evaluateWhichButtonPressed);
|
||||
Script.removeEventHandler(playButtonUuid, "mousePressOnEntity", evaluateWhichButtonPressed);
|
||||
Script.addEventHandler(_entityID, "mousePressOnEntity", onFirstClick);
|
||||
}
|
||||
|
||||
Messages.messageReceived.connect(onMessageReceived);
|
||||
|
@ -1,10 +1,3 @@
|
||||
// Copyright (c) 2020 Danielle Arlington.
|
||||
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, version 3.
|
||||
// https://www.gnu.org/licenses/gpl-3.0.en.html
|
||||
|
||||
(function () {
|
||||
var videoSyncServerScriptUrl = Script.resolvePath("videoSyncServerScript.js");
|
||||
var sourceUrl = Script.resolvePath("videoSync.html");
|
||||
@ -156,12 +149,6 @@
|
||||
if (useGatewayServer && gatewayServerConnected) {
|
||||
ws.send(JSON.stringify(wsNow));
|
||||
}
|
||||
console.log(JSON.stringify(messageData));
|
||||
var entity = Entities.getEntityProperties(videoPlayerChannel);
|
||||
entity.dimensions.y = (entity.dimensions.x / messageData.aspectRatio) + .1
|
||||
Entities.editEntity(videoPlayerChannel, {
|
||||
dimensions: entity.dimensions
|
||||
});
|
||||
} else if (messageData.action == "play") {
|
||||
timeStamp = messageData.timeStamp;
|
||||
if (intervalIsRunning) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user