+ 1
How can i insert files?
How can i use url of an image? How can i add other files like audio and video in my code ?
3 Antwoorden
+ 2
You can use the <video> tag to embed a video.
<video src="https://example.com/movie.mp4" controls width="320" height="240"> </video>
Audio tag:
<audio src="https://example.com/audio.mp3" controls></audio>
Img tag:
<img src="https://example.com/photo.jpg">
Use the following file extensions:
Audio: .mp3
Video: .mp4
Image: .jpg or .png
Src attribute indicates the source of the file.
Controls makes elements visible.
+ 1
you have to upload your file to a repository that will host and provide accessible url for it . You can't directly link to files in your device. While you might be able to access it locally in your code, other people can't.
+ 1
Hailemariam , I would like to add something to what Bob_Li said.
In case you have uploaded the audio in Dropbox, you might want to modify the link a bit, as follows:
Example audio file URL:-
"https://www.dropbox.com/scl/fi/zcwrwpdesqcdh90pw1fg9/Come-See-The-Wonder.mp3?rlkey=3nddyhkvzcgqpkgf9hk7f3km9&st=ms15zhw "
Modify this to:-
"https://www.dl.dropboxusercontent.com/scl/fi/zcwrwpdesqcdh90pw1fg9/Come-See-The-Wonder.mp3?rlkey=3nddyhkvzcgqpkgf9hk7f3km9&st=ms15zhwi&dl=0 "
[Basically, I just changed "www.dropbox.com" to "www.dl.dropboxusercontent.com" keeping everything else unchanged.]
I don't know if this is standard, but it works quite well for me. Hope this helps. Keep coding.
A gentle reminder: Kindly use the search bar before posting a question.
https://www.sololearn.com/discuss/1288998/?ref=app
https://www.sololearn.com/discuss/2074453/?ref=app
https://www.sololearn.com/discuss/2316175/?ref=app
https://www.sololearn.com/discuss/1425849/?ref=app
https://www.sololearn.com/discuss/605245/?ref=app