Open s-b-repo opened 1 year ago
Question: why would a user send video to a chat bot? This ain't telegeam with unlimited storage.
Question: why would a user send video to a chat bot? This ain't telegeam with unlimited storage.
this for ai on your ro do list
Allow bot send video
Not planning to add such thing in distant future. This is a chatbot, at max I'll add sending photo (only from ai, not from user) to keep power usage and complexity low
Not planning to add such thing in distant future. This is a chatbot, at max I'll add sending photo (only from ai, not from user) to keep power usage and complexity low
you could let it send some videos like youtube videos or twitch clips
Yes will do that, but Instead of downloading, will allow embedded code with video playback.
Planning to add YouTube video player API https://developers.google.com/youtube/iframe_api_reference
Also have "plyr" in mind. Demo command: "play something" Player position on side bar, so that one can chat with music on ( by hiding sidebar) Or on top of page (not voting for this one)
Issue on using anything YouTube : on Android playback will stop when user leaves screen (uncontrollable)
try newpipes method
try newpipes method
Interesting app, sadly its an app. Can you find any web alternative with api
invidius
CORS issue on Hotlinking to player
Noted, will add in future updates
You can use various video processing libraries like FFmpeg or GStreamer to manipulate the video files and streaming protocols like HLS or MPEG-DASH to serve them over the internet. You can also use third-party APIs like Cloudinary or Amazon S3 to store and retrieve the video files. However, it's important to note that enabling a chat AI to send videos on a self-hosted website could potentially create legal or ethical issues, especially if the videos are not moderated or monitored for inappropriate content. It's important to carefully consider the implications of such a feature before implementing it.
Sure, here's an example of how you could allow a chat AI to send videos on a self-hosted website using HTML and JavaScript:
python
javascript
function uploadVideo() { var file = document.querySelector('input[type="file"]').files[0]; var xhr = new XMLHttpRequest(); xhr.open('POST', 'upload.php', true); xhr.upload.onprogress = function(e) { if (e.lengthComputable) { var percentComplete = (e.loaded / e.total) * 100; console.log(percentComplete + '% uploaded'); } }; xhr.onload = function() { if (this.status === 200) { console.log('Video uploaded!'); } else { console.error('Error uploading video'); } }; var formData = new FormData(); formData.append('video', file); xhr.send(formData); }
php
<?php if ($_FILES['video']['error'] === UPLOAD_ERR_OK) { $tempName = $_FILES['video']['tmp_name']; $fileName = $_FILES['video']['name']; $uploadDir = '/path/to/uploads/directory/'; $targetPath = $uploadDir . $fileName; move_uploaded_file($tempName, $targetPath); echo 'Video uploaded successfully'; } else { echo 'Error uploading video'; } ?>
Note that this code is just an example and would need to be customized to fit your specific website and use case.
Here's an alternative implementation of the same functionality using Node.js and the Express framework:
npm install express multer
javascript
const express = require('express'); const multer = require('multer'); const app = express(); const upload = multer({ dest: 'uploads/' });
app.post('/upload', upload.single('video'), (req, res) => { if (!req.file) { return res.status(400).send('No video uploaded'); } res.send('Video uploaded successfully'); });
app.listen(3000, () => { console.log('Server listening on port 3000'); });
php
Again, note that this code is just an example and would need to be customized to fit your specific website and