Download one video / file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Download one video / file
Hi,
I was asking one question about video in another forum, and for one of my doubts, Klaus suggested me to write it in this forum!
The summary of my question is that i was trying to download one video from my PC to one iPad or to one android phone.
So, i will use one database where i will place all the names of the videos i have and with one datagrid show this list to can choose one ( all what is concerning to database and datagrids of my example i am able to do it ).
But once he made the selection how can i download it? This video will be in this location: "/Users/aebki/Downloads/"
And if we use one public Ip it should be something like this:
"//myPublicIp/Users/aebki/Downloads/" '
So how can i download this to the iPad or the android phone?
Regards.
I was asking one question about video in another forum, and for one of my doubts, Klaus suggested me to write it in this forum!
The summary of my question is that i was trying to download one video from my PC to one iPad or to one android phone.
So, i will use one database where i will place all the names of the videos i have and with one datagrid show this list to can choose one ( all what is concerning to database and datagrids of my example i am able to do it ).
But once he made the selection how can i download it? This video will be in this location: "/Users/aebki/Downloads/"
And if we use one public Ip it should be something like this:
"//myPublicIp/Users/aebki/Downloads/" '
So how can i download this to the iPad or the android phone?
Regards.
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Download one video / file
Are you trying to play the videos in a player object? If so does this work?
I have had success playing videos from a public folder on my google drive this way.
--Sefro
Code: Select all
set the filename of player "MyPlayer" to "http://myPublicIp/Users/aebki/Downloads/MyVideo.mp4"
--Sefro
Last edited by sefrojones on Thu Mar 19, 2015 8:22 pm, edited 1 time in total.
Re: Download one video / file
Hi Sefro,
Yes, the final target was to play the videos i have in my PC in one iPad or android phone.
But i thought that i had to download it to make it play. But if i don't need it is better!
So i will try to test it this evening.
Once i will test it i will write telling if i managed. But if you already did it and it worked it is a very good sign for me!
Regards
Yes, the final target was to play the videos i have in my PC in one iPad or android phone.
But i thought that i had to download it to make it play. But if i don't need it is better!
So i will try to test it this evening.
Once i will test it i will write telling if i managed. But if you already did it and it worked it is a very good sign for me!
Regards
Re: Download one video / file
Hi Sefro,
I tried it, but it is not working for me.
But i think that the problem i have is with the path.
In my Mac i have the video here: "Users/aebki/Downloads/Video2.mp4"
and my public ip is "8x.32.xx.182"
so this is the correct path and the correct code?
Because in the simulator is not working!
And as for you is working i am thinking it is one problem of path.
Regards.
I tried it, but it is not working for me.
But i think that the problem i have is with the path.
In my Mac i have the video here: "Users/aebki/Downloads/Video2.mp4"
and my public ip is "8x.32.xx.182"
so this is the correct path and the correct code?
Code: Select all
set the filename of player "MyPlayer" to "http://8x.32.xx.182/Users/aebki/Downloads/Video2.mp4"
And as for you is working i am thinking it is one problem of path.
Regards.
Re: Download one video / file
Player objects are not supported on mobile and so setting the filename of a player on iOS won't do anything either!
You need to create and use a native video player on iOS, like this:
http://lessons.runrev.com/m/4069/l/2928 ... -on-mobile
According to the dictionary about "mobilecontrolset" you can also supply a URL for the "filename" of the native player!
You need to create and use a native video player on iOS, like this:
http://lessons.runrev.com/m/4069/l/2928 ... -on-mobile
According to the dictionary about "mobilecontrolset" you can also supply a URL for the "filename" of the native player!
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Download one video / file
Oops, yes Klaus is correct. You will need to use a native mobile player object. You should still be able to set it's filename to the URL you'd like to use with "mobilecontrolset"
--Sefro
edit: just did a quick test of this on android and this worked. i just placed a regualr rectangle graphic place on the card in the location I wanted the player to appear, then put this in the opencard script of the card containing the video player:
it worked well on android, I assume it will work the same on iOS. Hope that helps.
--Sefro
edit: just did a quick test of this on android and this worked. i just placed a regualr rectangle graphic place on the card in the location I wanted the player to appear, then put this in the opencard script of the card containing the video player:
Code: Select all
on openCard
mobileControlCreate "player", "videoControl"
mobileControlSet "videoControl", "filename", "https://ia700408.us.archive.org/17/items/CC501_hypercard/CC501_hypercard_512kb.mp4"
mobileControlSet "videoControl", "showController", true
mobileControlSet "videoControl", "visible", true
mobileControlSet "videoControl", "rect", the rect of grc "rectangle"
mobileControlDo "videoControl", "play"
end openCard
Re: Download one video / file
Hi Sefro,
It worked well your example!
At least in my iPad simulator, so i imagine that it will work well too in the real device!:-)
The problem i have is when i change to look for one video i have in my Mac.
Do you know how i should pass my path? I have something wrong with this!:-(
//8x.32.xx.182/Users/aebki/Downloads/Video2.mp4
Regards.
It worked well your example!
At least in my iPad simulator, so i imagine that it will work well too in the real device!:-)
The problem i have is when i change to look for one video i have in my Mac.
Do you know how i should pass my path? I have something wrong with this!:-(
//8x.32.xx.182/Users/aebki/Downloads/Video2.mp4
Regards.
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Download one video / file
In order for this to work for videos on your home computer, your home computer must be visible to the internet. You may also have to check your firewall and forward port 80 to the computer hosting the videos. One option, which I find better than hosting files on my own computer, is to use a public folder on google drive, it's free and you don't have to worry about making your personal computer accessible to the internet. Here is a tutorial on how to set up a folder in google drive:
https://support.google.com/drive/answer/2881970?hl=en
Once you have a public folder, you can upload your videos to it, and just point your mobile player at the google drive URL. This will also save you bandwidth and probably be faster. I know googles servers are faster than MY home computer and internet connection....
--Sefro
https://support.google.com/drive/answer/2881970?hl=en
Once you have a public folder, you can upload your videos to it, and just point your mobile player at the google drive URL. This will also save you bandwidth and probably be faster. I know googles servers are faster than MY home computer and internet connection....
--Sefro
Last edited by sefrojones on Fri Mar 20, 2015 3:20 pm, edited 1 time in total.
Re: Download one video / file
Hi Sefro,
Yes, what you say is the 'correct way' i think!
I was only trying to test it first in my computer before to have to do it from Google Drive or another storage site.
But yes, i can do it like you said!
Regards.
Yes, what you say is the 'correct way' i think!
I was only trying to test it first in my computer before to have to do it from Google Drive or another storage site.
But yes, i can do it like you said!
Regards.
Re: Download one video / file
Hi Sefro,
So, i went to Google Drive and i uploaded one video to test.
I followed the steps in the link you gave.
So, now i have the video shared.
This is the link i have when i finished the steps:
"https://drive.google.com/file/d/0B-8LGB ... sp=sharing"
so the "doc id" is "0B-8LGBoJ3fIbVXpXb3JaX0M5M0lPdnN6SWdpdUgtUU5WT093"
I tried with this line
and also with this one
But anyone worked!
Where is my mistake???
Regards.
So, i went to Google Drive and i uploaded one video to test.
I followed the steps in the link you gave.
So, now i have the video shared.
This is the link i have when i finished the steps:
"https://drive.google.com/file/d/0B-8LGB ... sp=sharing"
so the "doc id" is "0B-8LGBoJ3fIbVXpXb3JaX0M5M0lPdnN6SWdpdUgtUU5WT093"
I tried with this line
Code: Select all
mobileControlSet "videoControl", "filename", "www.googledrive.com/host/0B-8LGBoJ3fIbVXpXb3JaX0M5M0lPdnN6SWdpdUgtUU5WT093"
Code: Select all
mobileControlSet "videoControl", "filename", "https://drive.google.com/host/0B-8LGBoJ3fIbVXpXb3JaX0M5M0lPdnN6SWdpdUgtUU5WT093"
Where is my mistake???
Regards.
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Download one video / file
aebki,
It appears that google may have changed the way that files are hosted since I last tried this, but here is a link to the exact tutorial that worked for me:
http://drivehosting.pdlindgren.us/
Instead of putting index.html into the folder, you can put your videos instead. and the URL to the video will be the URL displayed in step 8 with "/yourvideo.mp4" added to the end of it. Then surf to that location, and it will display in your web browser. Now you can copy the long URL in your browser and use that as the filename of your native player. I just tested this on android and it is working as expected.
Hope this helps.
-sefro
edit: the final URL you use as the filename will look something like this:
You can also use this method to host any other kind of file including livecode stacks
It appears that google may have changed the way that files are hosted since I last tried this, but here is a link to the exact tutorial that worked for me:
http://drivehosting.pdlindgren.us/
Instead of putting index.html into the folder, you can put your videos instead. and the URL to the video will be the URL displayed in step 8 with "/yourvideo.mp4" added to the end of it. Then surf to that location, and it will display in your web browser. Now you can copy the long URL in your browser and use that as the filename of your native player. I just tested this on android and it is working as expected.
Hope this helps.
-sefro
edit: the final URL you use as the filename will look something like this:
Code: Select all
https://4c1ae64e030ba6bc5bcb2510a44f0c754e5982b6.googledrive.com/secure/AIMa9vojKoRe2EBfwhNHdNjO5czw8N0ZHCgh4ObpPbfjMyflkYN2rhVQbc0m_eRRQCbQP4FcukbFeFWBiTt7VHIKVZAKpgtrDHpgCR3Cs7x3IvSMstfQ3EVk2FevRftXZdtS_6khPz1xTR_-JjO2NaOk0dUWXPIEQr543FIRsD68_Z_k2NyifdK0Bl4dSL3EtQ4i9nAEe-QWqCC4byEVWvRLjgluL_uies7_2wGt9meddReL-Y-ecmb9tVC8cCDHdSdDR385CwxHZq5mWvVl55W9cN374ZaxEDxH1ZJUiUmIh7yZxjQwVEiDiTsi3_qAQrOw9RRrA47j71O7lASr241ov_mkr8dTvEUJbW7dhKYxYgobcdBcosmmqSYhAPKl8G8GmPTqexJN0bGZ9CmkRiamGayjoUtnknbGKH8xkyw0KCVlpCo0sL-Ikd79yqhTBZljCWwWZa4WaHYm2jeiJKdz4eQs1jahdZO9CWC3WeZd0qSCdqkir1Y1mBcyewnA4kuDTPnpgZYbXU4QBWPNQQe1NfR3wbS7MKI_55JfjBVf6v-gMFWfoFZIiNQ1ATeHIAS_3IfkUGK2rb1MdveWq1ayaZsA4W15ng==/host/0B9myvEGzDKvCfjNXR0ZzQUxfSWxuemVZU2Z2UE4zUzhvWmJVdkxqYjlqQ1ZBV05IY2FIcDg/Lesson1.mp4
Re: Download one video / file
Hi Sefro,
Thanks a lot, this time it worked well for me!
I could see the video i have in Google Drive!:-)
Anyway, i am still curious to know how to download one video or file to the iPad or android phone.
So, how can i make one download? For example the same video that now i can see from the drive.
Regards.
Thanks a lot, this time it worked well for me!
I could see the video i have in Google Drive!:-)
Anyway, i am still curious to know how to download one video or file to the iPad or android phone.
So, how can i make one download? For example the same video that now i can see from the drive.
Regards.
-
- Livecode Opensource Backer
- Posts: 447
- Joined: Mon Jan 23, 2012 12:46 pm
Re: Download one video / file
If you want to download videos, you can download them to the specialfolderpath("Documents"). Depending how large these files are, they might take a while to actually download, so you'll probably want to give the user some kind of visual warning that it is downloading. Here, i Just use a field named "loading"
and once the file is downloaded, we can play this file in a native player like this:
As before, I've tested this on android, and it is working, I assume that it will work as well on iOS.
--Sefro
Edit: You can skip the native player altogether with this :
unfortunatley this option will leave your app, and if the user hits back button (at least on android) it will take them back out to the OS.
Code: Select all
put "Downloading..." into fld "Loading"
set the defaultfolder to specialfolderpath("Documents")
put url "http://path/to/yourfile.mp4" into URL "binfile:myfile.mp4"
put "DONE!" into fld "loading"
Code: Select all
put specialfolderpath("Documents")&"/myfile.mp4" into tPath
mobileControlCreate "player", "videoControl"
mobileControlSet "videoControl", "filename", tPath
mobileControlSet "videoControl", "showController", true
mobileControlSet "videoControl", "visible", true
mobileControlSet "videoControl", "rect", the rect of grc "rectangle"
mobileControlDo "videoControl", "play"
--Sefro
Edit: You can skip the native player altogether with this :
Code: Select all
play video "path/to/video.mp4"
Re: Download one video / file
Hi Sefro,
Thanks a lot for your answer!
I will test it a little bit later...anyway is already nice to know that is working for you!!!
Regards.
Thanks a lot for your answer!
I will test it a little bit later...anyway is already nice to know that is working for you!!!
Regards.