Skip to content

Instantly share code, notes, and snippets.

@scottsappen
Last active December 21, 2015 14:39
Show Gist options
  • Save scottsappen/6321545 to your computer and use it in GitHub Desktop.
Save scottsappen/6321545 to your computer and use it in GitHub Desktop.
HTML5 video tag - I can't wait until every browser plays nice and supports it in full AND everyone upgrades to a recent version of said browser(s).
from google.appengine.ext.webapp import blobstore_handlers
blobstore.create_upload_url('some URL of yours')
class SubmitNewPropp(blobstore_handlers.BlobstoreUploadHandler):
def post(self):
inputUploads = self.get_uploads()
inputUploadedHybridFile = inputUploads[0]
blobkey = str(inputUploadedHybridFile.key())
<video width="420" height="420">
<source src="/servevideo/{{ blobvideokey }}" type="video/webm" />
<source src="/servevideo/{{ blobvideokey }}" type="video/mp4" />
<source src="/servevideo/{{ blobvideokey }}" type="video/ogg" />
Your browser does not support the video tag.
</video>
class ServeVideoHandler(blobstore_handlers.BlobstoreDownloadHandler):
def get(self, resource):
resource = str(urllib.unquote(resource))
blob_info = blobstore.BlobInfo.get(resource)
self.send_blob(blob_info)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment