create-fuzionx 0.1.51 → 0.1.52
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/templates/spa/meta.json
CHANGED
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
<div class="live-chat-input-area">
|
|
131
131
|
<input id="chat-input" type="text" class="form-input" placeholder="{{ t(key="live.chat_placeholder", default="메시지 입력...") }}" style="flex:1;" />
|
|
132
132
|
<button class="btn btn-primary" style="padding:.4rem .75rem;" onclick="sendChat()">{{ t(key="live.send", default="전송") }}</button>
|
|
133
|
-
</div>
|
|
133
|
+
</div>
|
|
134
134
|
</aside>
|
|
135
135
|
</div>
|
|
136
136
|
{% endblock %}
|
|
@@ -148,9 +148,12 @@ let connection = null;
|
|
|
148
148
|
if (_autoNickname) {
|
|
149
149
|
document.getElementById('nickname-input').value = _autoNickname;
|
|
150
150
|
selectRole(_role);
|
|
151
|
-
setTimeout(() => joinRoom(), 100);
|
|
151
|
+
setTimeout(() => joinRoom(), 100);
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
_autoNickname = '{{auth.user.name}}';
|
|
155
|
+
document.getElementById('nickname-input').value = _autoNickname;
|
|
156
|
+
|
|
154
157
|
function selectRole(role) {
|
|
155
158
|
_role = role;
|
|
156
159
|
document.getElementById('role-publisher').className = 'live-role-btn' + (role === 'publisher' ? ' active' : '');
|
|
@@ -248,6 +251,14 @@ async function joinAsPublisher(nickname) {
|
|
|
248
251
|
connection.on('slot', (slot) => {
|
|
249
252
|
const label = document.getElementById('slot-label-' + slot.slotIndex);
|
|
250
253
|
if (label) label.textContent = slot.nickname;
|
|
254
|
+
// 슬롯 재할당 시 srcObject 복구 (slot_remove에서 null로 바뀐 경우)
|
|
255
|
+
if (slot.stream) {
|
|
256
|
+
const videoEl = document.getElementById('slot-video-' + slot.slotIndex);
|
|
257
|
+
if (videoEl && !videoEl.srcObject) {
|
|
258
|
+
videoEl.srcObject = slot.stream;
|
|
259
|
+
videoEl.play().catch(() => {});
|
|
260
|
+
}
|
|
261
|
+
}
|
|
251
262
|
});
|
|
252
263
|
|
|
253
264
|
connection.on('slot_remove', ({ slotIndex }) => {
|
|
@@ -282,6 +293,14 @@ async function joinAsViewer(nickname) {
|
|
|
282
293
|
connection.on('slot', (slot) => {
|
|
283
294
|
const label = document.getElementById('slot-label-' + slot.slotIndex);
|
|
284
295
|
if (label) label.textContent = slot.nickname;
|
|
296
|
+
// 슬롯 재할당 시 srcObject 복구
|
|
297
|
+
if (slot.stream) {
|
|
298
|
+
const videoEl = document.getElementById('slot-video-' + slot.slotIndex);
|
|
299
|
+
if (videoEl && !videoEl.srcObject) {
|
|
300
|
+
videoEl.srcObject = slot.stream;
|
|
301
|
+
videoEl.play().catch(() => {});
|
|
302
|
+
}
|
|
303
|
+
}
|
|
285
304
|
});
|
|
286
305
|
|
|
287
306
|
connection.on('slot_remove', ({ slotIndex }) => {
|