Streaming Audio with Google App Engine

Can I transfer an audio file from BlobStore to AppEngine in general?
And if so, what about a .mp3 streaming file from a direct URL?

+4
source share
1 answer

Yes!! This is my implementation:

 public class Serve extends HttpServlet { private static final long serialVersionUID = 5603629129606331547L; public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException { BlobKey blobKey = new BlobKey(req.getParameter("blob-key")); BlobstoreServiceFactory.getBlobstoreService().serve(blobKey, res); } } 

.. and this is web.xml:

 <servlet> <servlet-name>Serve</servlet-name> <servlet-class><my-package>.Serve</servlet-class> </servlet> <servlet-mapping> <servlet-name>Serve</servlet-name> <url-pattern>/serve</url-pattern> </servlet-mapping> 

note that the β€œdirect url” (getServingUrl, I think you mean) exists only for images: https://developers.google.com/appengine/docs/java/images/overview#Transforming_Images_from_the_Blobstore

+5
source

Source: https://habr.com/ru/post/1411064/


All Articles