mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Update upload.html
This commit is contained in:
parent
38fa0df7ff
commit
39ed5a651f
@ -1,11 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<<<<<<< HEAD
|
||||
<video id="video" width="100%"></video>
|
||||
<center>
|
||||
<span id="up">Drag & Drop Video to Upload!</span>
|
||||
<button id="play">Play</button>
|
||||
=======
|
||||
<div class="model" style="display: none;">
|
||||
<video width="100%" controls autoplay></video>
|
||||
<audio width="100%" controls autoplay></audio>
|
||||
@ -13,7 +7,6 @@
|
||||
</div>
|
||||
<center>
|
||||
<p>Drag & drop videos, songs, or images! <input type="file" multiple></p>
|
||||
>>>>>>> master
|
||||
</center>
|
||||
|
||||
<script src="../jquery.js"></script>
|
||||
@ -22,30 +15,6 @@
|
||||
|
||||
<script>
|
||||
var gun = Gun(location.origin + '/gun');
|
||||
<<<<<<< HEAD
|
||||
var video = {data: null};
|
||||
|
||||
$('body').upload(function(e){
|
||||
var b64 = (((e.event || e).target || e).result || e);
|
||||
gun.get('test').get('screen').put(b64);
|
||||
})
|
||||
|
||||
gun.get('test').get('screen').on((data)=>{
|
||||
if(!data){ return }
|
||||
$('#video').get(0).src = video.data = data;
|
||||
})
|
||||
|
||||
$('#play').on('click', ()=>{
|
||||
if(video.playing || !video.data){
|
||||
$('#play').text("Play")
|
||||
$('#video').get(0).pause();
|
||||
video.playing = false;
|
||||
return;
|
||||
}
|
||||
$('#play').text("Stop");
|
||||
video.playing = true;
|
||||
$('#video').get(0).play()
|
||||
=======
|
||||
|
||||
$('html').upload(function resize(eve, up){
|
||||
if(up){ return up.shrink(eve, resize, 1024) }
|
||||
@ -61,6 +30,5 @@ gun.get('test').map().on(function(data){
|
||||
if(type.indexOf('audio') + 1){ ui = $('audio').get(0) }
|
||||
if(!ui){ return }
|
||||
$(ui).clone().prependTo('center').get(0).src = data;
|
||||
>>>>>>> master
|
||||
})
|
||||
</script>
|
Loading…
x
Reference in New Issue
Block a user