DEV Community

Abolhasan Momeni
Abolhasan Momeni

Posted on

How to delete preview video file with javascript or jquery

js code :

$('#showvideo').on('change', function () {
        var $source = $('#video_here');
        $source[0].src = URL.createObjectURL(this.files[0]);
        console.log($source[0].src);
        $source.parent()[0].load();
    });
Enter fullscreen mode Exit fullscreen mode

html code:

<video class="video"controls>
<source src="mov_bbb.mp4" id="video_here">
</video>
<input type="file" name="video" id="showvideo" class="file_multi_video" accept="video">
Enter fullscreen mode Exit fullscreen mode

...............................................................
I try to delete scr but nothing happen,
how can I deselect the video that selcted.

thanks for your helping guy's,

Top comments (0)