I have one web page, where I am displaying the live photos(Combination of photo and video). I would like to download both photo and video after clicking on the download button.
I got succeed to download it in Chrome and Mozilla browser of the desktop but it gets to fail in iPhone devices.
Please suggest.
Thank you in advance.
Here is my code:
<a href="#" id="downloadImage" data-photosrc="sample.jpg" data-videosrc="sample.mov">Download Image</a>
<script>
$("#downloadImage").click(function () {
var video = 'http://www.example.com/live-photo-web/sample.mov';
var photo = 'http://www.example.com/live-photo-web/sample.jpg';
downloadURI(video, "sample");
downloadURI(photo, "sample");
})
function downloadURI(uri, name) {
var link = document.createElement("a");
link.download = name;
link.href = uri;
link.click();
link.remove();
}
Aucun commentaire:
Enregistrer un commentaire