How To Play Video On Google Drive With A Player Object?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
How To Play Video On Google Drive With A Player Object?
I've been trying to play a video uploaded to Google Drive with a player object. I can't get a valid file path.
Here's the Google Drive shareable link to video "sampleMPG.mpg". It's the default LiveCode sample video. Note the spaces within and at the end of the link.
https://drive.google.com/open?id=1E_Vb9 ... FKgV1FrLkO_
What would be the file path code for an LC player object?
set the fileName of player 1 to "??"
Terry
Here's the Google Drive shareable link to video "sampleMPG.mpg". It's the default LiveCode sample video. Note the spaces within and at the end of the link.
https://drive.google.com/open?id=1E_Vb9 ... FKgV1FrLkO_
What would be the file path code for an LC player object?
set the fileName of player 1 to "??"
Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html
https://tlittle72.neocities.org/info.html
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: How To Play Video On Google Drive With A Player Object?
I don't see spaces, I see underscores (on a mobile device anyway.) The link fails with an error in the browser too. Are you sure you copied the entire link?
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
Re: How To Play Video On Google Drive With A Player Object?
Thanks Jacque for responding. Yes, that's the shareable link, but the LC forum doesn't extend the link underline all the way across to include the last space. That's the code I was assigned. I can't change it. I tried with quotes but no improvement. I didn't add the underscores, that was done by the LC forum too, but it works just fine with the underscores, you just can't click it in the forum. My text-editor extends the link underline correctly and double-clicking opens the default web browser to the the video file.
But my question is how to change that shareable link to a filepath that the LC player object will accept. The address in the browser shows:
"https://drive.google.com/file/d/1E_Vb90 ... rLkO_/view"
An embed option gives:
"https://drive.google.com/file/d/1E_Vb90 ... O_/preview"
Neither work with a player object, neither work with the file name "/sampleMPG.mpg" appended to the link. Terry
But my question is how to change that shareable link to a filepath that the LC player object will accept. The address in the browser shows:
"https://drive.google.com/file/d/1E_Vb90 ... rLkO_/view"
An embed option gives:
"https://drive.google.com/file/d/1E_Vb90 ... O_/preview"
Neither work with a player object, neither work with the file name "/sampleMPG.mpg" appended to the link. Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html
https://tlittle72.neocities.org/info.html
-
- VIP Livecode Opensource Backer
- Posts: 7215
- Joined: Sat Apr 08, 2006 8:31 pm
- Location: Minneapolis MN
- Contact:
Re: How To Play Video On Google Drive With A Player Object?
I can't get it to work in a player either, I think because it isn't really a link to the actual video but rather to a reference to a file on Drive. It does work in a browser widget though.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: How To Play Video On Google Drive With A Player Object?
The actual link is:
https://doc-14-7o-docs.googleuserconten ... FKgV1FrLkO_
This works. When copying the link above check that the underscore (last char) is not missing.
Assuming you are on Mac:
You can see the actual link after downloading the file in the "where from" - Finder info.
https://doc-14-7o-docs.googleuserconten ... FKgV1FrLkO_
This works. When copying the link above check that the underscore (last char) is not missing.
Assuming you are on Mac:
You can see the actual link after downloading the file in the "where from" - Finder info.
shiftLock happens
Re: How To Play Video On Google Drive With A Player Object?
Hi Jacque & [-hh]. Thank you for your help. I tried the direct address link but couldn't get it to work. Yes I included the last space. Could Google be creating a temporary file path that expires after a period of time? If you download the video again and with your method check the video's file path is it the same as the previous path you posted? Windows 7 doesn't support your method so I can't check it myself.
After some searching I came across a determined person in Stack Overflow who wrote a java script solution. I know nothing about java script. The Stack Overflow thread is:
https://stackoverflow.com/questions/415 ... g-java-dri
It also mentions Google's file storage method is not hierarchial, probably making the filepath for player object not possible. I think it would be useful to be able to play a video stored on Google Drive with a player object. I see the two workarounds as using a browser widget as Jacque suggested or using launch url and the Google Drive player. Terry
After some searching I came across a determined person in Stack Overflow who wrote a java script solution. I know nothing about java script. The Stack Overflow thread is:
https://stackoverflow.com/questions/415 ... g-java-dri
It also mentions Google's file storage method is not hierarchial, probably making the filepath for player object not possible. I think it would be useful to be able to play a video stored on Google Drive with a player object. I see the two workarounds as using a browser widget as Jacque suggested or using launch url and the Google Drive player. Terry
Code: Select all
on mouseUp --play video file on Google Drive with Google's player
if url ("https://www.google.com") = empty then --no internet
answer "Sorry, no internet connection." with "OK" titled "Error"
exit to top
end if
answer "Launch default web browser to play video stored on Google Drive?" with "Cancel" or "OK" titled "Play Video"
if it = "Cancel" then exit to top
put "https://drive.google.com/open?id=1E_Vb900T6Its8cDa4xnycFKgV1FrLkO_" into tPath --Google Drive shareable link
replace space with "%20" in tPath --spaces not allowed in url
launch url (tPath) --opens with default browser
end mouseUp
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html
https://tlittle72.neocities.org/info.html
-
- VIP Livecode Opensource Backer
- Posts: 2262
- Joined: Thu Feb 28, 2013 11:52 pm
- Location: Göttingen, DE
Re: How To Play Video On Google Drive With A Player Object?
Yes, the URL changes, probably from security reasons.
Currently it is
https://doc-14-7o-docs.googleuserconten ... FKgV1FrLkO
so you see the changed parts.
Your link above is to java not JavaScript. But there is also a JavaScript API and what you need is "Parents: get" and a call using your API_KEY. For using that JS API (what is not this trivial) you would need a browser widget anyway.
So it's not worth to do that for a player object (may be you have special reasons) because it works always with a browser widget:
For example by simply setting the htmltext of the widget to the embed code.
Currently it is
https://doc-14-7o-docs.googleuserconten ... FKgV1FrLkO
so you see the changed parts.
Your link above is to java not JavaScript. But there is also a JavaScript API and what you need is "Parents: get" and a call using your API_KEY. For using that JS API (what is not this trivial) you would need a browser widget anyway.
So it's not worth to do that for a player object (may be you have special reasons) because it works always with a browser widget:
For example by simply setting the htmltext of the widget to the embed code.
shiftLock happens
Re: How To Play Video On Google Drive With A Player Object?
[-hh]: Thank you for further testing. I understand and will focus on the browser widget. This forum is great and the skill set of the users here is amazing. Terry
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html
https://tlittle72.neocities.org/info.html