Difference between revisions of "Template:Support:DirectLink"

From 5etools Community Wiki
Jump to: navigation, search
m (How do you know if a link is a direct file?)
m (Direct Link Files)
 
(One intermediate revision by the same user not shown)
Line 2: Line 2:
 
: Several features will require the use of direct link files, so what are they?  
 
: Several features will require the use of direct link files, so what are they?  
 
<br/>
 
<br/>
:: ''A directly linked file is one that your browser can stream'' without ''use of any external player (youTube/Spotify), and without additional prior or pass-through authentication or redirection.''  
+
:: ''A directly linked file is one that your browser can stream'' '''without''' ''use of any site-specific media player (youTube/Spotify both use embedded players), and without additional prior or pass-through authentication or redirection.''  
 
<br/>
 
<br/>
 
:... and for the purposes of Roll20, it '''must''' ''also'' be a file yourself and your players/GM can access.
 
:... and for the purposes of Roll20, it '''must''' ''also'' be a file yourself and your players/GM can access.

Latest revision as of 03:09, 14 January 2020

Direct Link Files

Several features will require the use of direct link files, so what are they?


A directly linked file is one that your browser can stream without use of any site-specific media player (youTube/Spotify both use embedded players), and without additional prior or pass-through authentication or redirection.


... and for the purposes of Roll20, it must also be a file yourself and your players/GM can access.


YouTUBE, SoundCloud & Spotify

Right off the bat, let's answer the most common question - YouTube, Soundcloud & Spotify, don't work. The links they provide do not link the browser to the file, but to a player.
Both sites have embedded code to render parts that file you're listening to/playing thru their site's dedicated server-side player - and since that is how they operate, and that would conflict with Roll20's site working in their website native players - canvas; requests to load youtube/Spotify will fail.
Each website does what it does, and like radio, it only plays one channel (website) at a time. There are ways around that we'll discuss, but from a high-level overview - YouTube and Spotify won't work, and likely never will (natively).


How do you know if a link is a direct file?

By visual inspection:
A pretty easy way to check on that is if the URL (the address in the Address bar) ends with a file extension.
Example ( http://www.domain.com/directory/filename.<extension> [where <extension> could be .mp3, .mp4, .webm, .webp, .png, .gif, , .json etc etc, depending upon what feature you are using (LibreAudio, Animated Background, External Art, Insert Token by URL, Paste image from URL etc
  • For Music that would be files that end with:
.mp3 .mp4 .ogg .flac .wav .webm
  • For Video that would be files that end with:
.webm .avi .mp4


URLs that do not end with the file specifically listed, or that have additional elements on the end often are issuing redirections and so likely will not work.


Example of Bad URLS

examples of bad Media URLs (they won't work, and why they won't work -- so you can avoid them in your testing)


GENERAL

127.0.0.1/Users/GM/My_Documents/Roll20_Animated_Backgrounds/Supercool.mp4
That is a local file (that address is a coded loopback to whatever machine you are on) and nobody else will be able to see it as that URL goes only to that local machine.


https://drive.google.com/drive/u/3/folders/1l-7JbIsb60osH0f06iNzHVnq-0oY-VNp
That link doesn't have the file name, and ... That link either requires authentication, or issues a redirect - if pass-through authentication is required the Roll20 client will not pass that, and redirections are most often changes in HTML. The Roll20 canvas application player doesn't know what to do with it.


https://www.patreon.com/file?h=17052388&i=1882731
Note that the URL ends with ?<something>, that is what is called a GET. It is a means to passover information to the server, while sometimes these occur after the direct file name (ie. https://www.domain.com/directory/file_name.ext?resx=500&resy=270 to return a specific resolution) they are also used to pass authentication to allow login/password or pass thru session authorization.


IMAGES


VIDEOS
https://www.youtube.com/watch?v=aRaynveO0MQ
That's a youtube URL - like above, there is a website side actions that the link asks the browser to take to redirect or initiate some other elements, and the Roll20 client will not be able to act on that so those links WILL fail. 


AUDIO
https://soundcloud.com/user-585971590/sets/d-d-night
That's a SoundCloud URL, and they don't provide direct file access without API. So the links you get will generate a website side actions that the link will pull alot of HTML/CSS and some server-side scripts - all of which, are not an audio file, and so Roll20's canvas will not fail upon being asked to process.


https://open.spotify.com/track/2xGDOy0pPf7XQSBhvJ9lzn
That's a spotify URL, and they don't provide direct file access, and like Spotify and several audio streaming services links you get will link to their website, the link will pull a lot of HTML/CSS and some server-side scripts - all of which, are not an audio file, and so Roll20's canvas will fail upon being asked to process ANOTHER website inside its own website.


JSON/Homebrew
https://github.com/TheGiddyLimit/homebrew/blob/master/feat/Sample%20-%20Giddy%3B%20Magically%20Gifted%2C%20Whip%20Aficionado.json
While that absolutely does end with the .json extension, you'll note that visiting the site brings up something like this.
Github labeled.png
You'll note that visiting the site shows some hints on what that will not work.
The site has a number of UI elements, navigation bar, tabbed interface, search field, access to account information and some metadata content - all of that meets the concern about embedded media player - in this case a text editor ( ).
HOWEVER -- there is a means to get direct file access. The GitHub RAW button.png (raw) will lead to a direct file link.
https://raw.githubusercontent.com/TheGiddyLimit/homebrew/master/feat/Sample%20-%20Giddy%3B%20Magically%20Gifted%2C%20Whip%20Aficionado.json
This is a feature that is site-specific, but you will find that general concept from time to time - that a file link, instead of going to direct file, will bring up an embedded player, and that the player provides an option for a link to the direct file, or to download the file for use from a hosting service of your choice.
  • https://media.giphy.com/media/bcKmIWkUMCjVm/giphy.gif​​​​
    That's an animated .gif (see the ending bit of text? that says .gif -- the player doesn't use and cannot play animated gifs, if your file doesn't work, and ends in .gif, that's why.
     
  • https://i.imgur.com/zvATqgs.gifv
    That's the new animated .gif format .gifv.  (and in case you're wondering, renaming a file to .webm or mp4 won't make the file's "type" change - the file is written in a specific language/structure.  The player reads that language, and if its not in that language - it just doesn't work. 


By testing
This is the most obvious, but least used. Take the URL and try opening that URL in a different browser, you may also wish to have one of more players confirm that they can do can.}}


IMAGES
VIDEOS
Videos opened in the browser will open the video with a minimal set of controls. (See video below)
BrowserVideoVID.gif


It should not have a lot of ads, playlist, navigation or account management nav bar, or voting/rating system.
ie, not this.
YouTube labeled.png
AUDIO
Direct File URLS for audio will initiate either a file download or prompt the browser to start playing the file. (See sample screenshoot from a Chrome browser below).
AudioPage.png
JSON/Homebrew
When viewed through the browser it will looking like code listing in the browser.
(Example from a RAW address on GitHub.
GithubRAW.png


One/Some/All of my players cannot see/hear the animation/audio, but I can!

Troubleshooting
Check to see if the player(s) are using the supported environment, have the most current versions of the browser and extensions are installed, and configured correctly.
Most likely the URL you have chosen isn't a public address, and so your browser is playing it because YOU/your machine is authorized already to see that file, while your players are not.
Solution Steps:
Move the file to a place everyone has access to (see the specific feature for suggested locations) or by giving everyone access rights to that location.


Features that use this:

LibreAudio
Animated Background
External Art
Insert Token by URL
Paste image from URL