wandererfan wrote: ↑
Mon Dec 10, 2018 3:06 pm
I'm having trouble with videos on the forum, both posted by others and the ones I try to post.
Videos hosted on youtube work reliably.
Videos hosted elsewhere (github, dropbox, etc) often fail to play with one of two messages:
"No Video with supported format and MIME type found"
"Sorry this URL is not supported"
Other times I get a black box with no messages.
I've tried with Firefox and Chromium. Same results.
I can create videos locally (webm and mp4) and they play every time.
Any guesses? Things to check further? Security settings?
OS: Linux Mint 19 Tara
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.15363 (Git)
Build type: Release
Python version: 2.7.15rc1
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)
The trick to getting the video hosted on github to play on the forum is get the link to the raw file, not the link to the file where you see it in the listing. Select view raw or something similar and post that url inside the video tags. I have written this python script for automating this process for me:
Code: Select all
import sys, os
"""This is a way for me to generate the url needed for posting the videos to the
FreeCAD forum boards. In Windows 10 Explorer I'm able to drag and drop the webm video to
this file, which then creates the url and video tags string, and then copies it to the clipboard.
This greatly improves things because now I don't have to go to github.com each time to get the url.
"""This is just to modify the file so it appears at the top of the folder when sorting by modified date."""
fin = open(__file__, 'r')
code = fin.read()
fout = open(__file__, 'w')
return subprocess.check_call(cmd, shell=True)
prepend = "https://raw.githubusercontent.com/mwganson/FreeCAD-videos/master/"
if len(sys.argv) != 2:
input("Please drag and drop a file or enter filename as command line parameter")
fileName = os.path.basename(sys.argv)
data = "[video]" + prepend + fileName + "[/video]"
#Following could be removed as it only pauses the screen and displays the confirmation
text = input(data + " has been copied to clipboard (press enter to close) ")
It is written for windows, but could be ported to other os without much difficulty by modifying the copy2clip() function. You would also need to modify it to point to your repository instead of mine, obviously. To use the script I just drag and drop my new video on to it in windows explorer. It pops up a box informing me the url it generated was copied to the clipboard, which I then paste into the forum. I use git bash to upload the file to the repository in the usual way:
git add .
git commit -m"message"
This I have also automated in another script.
I have checked github's terms of service and I see nothing in it that forbids using it in this manner. Certainly, if the videos (all documenting FreeCAD) were in the FreeCAD repository github would have no complaint. It can be argued my video repository is an extension of FreeCAD and acting as extended documentation. That would be my argument to them if they told me something.