I have a Java Spring Boot web app which should allow the users to upload their videos. I did some researches and I found that JWPlayer is the best solution in this way.
I would like to upload videos to JWPlayer and store in a database the id of the uploaded video related to a particular user.
The only problem is that the documentation is not so clear, and I don't understand how can I interact with JWPlayer with my Spring Boot back end.
There is just this page which does not show any code nor give any intuition of the process.
JWPlayer doesn't provide a Java or Spring Boot integration, but it does have APIs that you can call from Java. The steps go as follows:
Create your video metadata by calling /v1/videos/create. I highly recommend using the S3 upload method. If you're not sure how to make this call you can read about the call structure and authentication
Upload your video by using the link returned in the create call. You can read more about how to do this here if you do the S3 method, or here otherwise.
There is a pretty good example of how this entire process goes written in Python on the page you linked.
If you're uploading videos on behalf of your users, it'd probably be easiest to do this on the frontend with JavaScript instead of proxying through your Java application
Related
I asked this question before but it was unanswered for a week or so I think so I decided to ask again but with a different formula.
I have a JFX desktop app. one of the features of one of the modules contains a video upload to the server. I searched this around a lot but the solutions I found are in two categories
using servlet / jsp on the server and service in the desktop app
copying the file locally (not what I want)
now I am ok with havign a service doing it the upload that's what I expect but I dont see the need of having a deployment on the server plus I already have a webapp. Is it possible to just have a webservice in the server and call it in the desktop app code? I haven't found anything on this.
Yes, it's possible and preferable choice.
The potential solution I see would be:
deploy a file REST service on your File server where the videos would be held.
Example Rest service in Java: https://github.com/polopolyps/fileserver
Then in your java FX application you simply send user file (a video) using REST lib, see: http://square.github.io/retrofit/
and Voila you have your functionality.
I'm using Google App Engine for Java, and I'm trying to write JUnit tests for my code that deals with the blobstore. How can I put a blob in the blobstore to use during testing (after it has been configured to keep everything in-memory with the LocalBlobstoreServiceTestConfig)? It seems like the solution should be very simple and basic, but somehow I cannot find it.
I imagine it was possible using the Files API, but I have steered clear of it because it is being discontinued (next week).
The only way I know of to get blobs into the blobstore outside of tests is via a multi-part form upload. However, I don't know how I would do that in the context of a JUnit test.
One can also interact with Google Cloud Storage objects via the blobstore API, but I have chosen to use the vanilla blobstore so that I don't need to loop yet another service (and its client libraries) into my app.
So again I ask, how do I get a blob in there so I can test the code that uses it?
It seems as though you're correct that this feature does not exist. You should open a Feature Request issue in the public issue tracker and any other users interested in this can star the issue. Once that's done, it will be triaged and logged Google-side for implementation over time.
I am a C# developer who recently decided to venture into the mobile dev world specifically android dev using java. It has been a smooth ride until now. While I'm usually able to follow the tutorials on the android developers site and other sites easily, uploading an image/video to the app engine blobstore or cloud storage seems to be a bit over my head. I cant seem to wrap my head around the process.
I have already done the necessary steps to get my app running on app engine. I am able to register devices and save basic entities to the cloud but I cant seem to get any of the tutorials to work form me.
Basically my app allows users to take images or videos and then have them posted to my back end as part of a file sharing type of game.
I am not asking for someone to give me code that can accomplish this, instead pointing me to a very thorough tutorial would be great!
1.I need understand the role of a servlet (most examples use this for uploading to blobstore)
2.Where should the servlet reside?
3.Is there another way to do this without using a .jsp page for the file uploading ?
4. I have set up the app engine back end for my project including endpoints. Is there a way to send the images/video that way to the server and still be able to retrieve a serving url to fetch the image/video later?
I have been stuck on this for a week now and I'm getting quite discouraged as I cannot seem to adapt any of the tutorials that I have read to suite my needs. There are a few dark spots in my mind where the entire process is concerned. Since I am not familiar with java, servlets etc I'm stumbling in the dark and I just need a lamp to light my path. I think i'm just a step or two away.
BTW I have looked at these questions and tried the code suggested to no avail before deciding to post my own.
Upload to Appengine Blobstore in Android
BlobStore vs Cloud Storage for storing user uploaded images
Upload image from Android to Google Cloud Storage or Google App Engine Blobstore
Please help!
NOTE: I don't have an interface where the user gets to choose the image/video as it is to be taken directly from the camera and sent to the server(not sure that makes a difference).
You need to do a lot more reading. First understand servlets in general. Then learn how to use the blobstore or cloud storage api. Then read how to post directly to blobstore (not to the servlet) with a post-save servlet callback.
Welcome to the world of Java!
I'll try my best to explain the Servlets/JSPs part. I dont know a whole lot about Google app engine.
1) Servlets are nothing but Java objects but with more priveleges. Servlets know how to handle a web request! There are many things that come to mind when we talk about web request processing:
who maps the URL to this servlet?
Who gives this servlet user request parameters?
How can I guarantee only authorized users can access this servlet?
list goes on......
Answer to all above questions is a web container. And in the world of Java only one web container rules (others might differ): Apache Tomcat.
In short, servlets are Java objects created for you by Tomcat.
Where should the servlet reside?
They reside in Tomcat.
Is there another way to do this without using a .jsp page for the file
uploading ?
You dont need a JSP to send requests to a servlet. You can use jquery, python or anything else. As long as its a valid web request.
I have set up the app engine back end for my project including
endpoints. Is there a way to send the images/video that way to the
server and still be able to retrieve a serving url to fetch the
image/video later?
See the tutorial here. Especially 'Implementing Tweet My Picture' section.
Google app engine has Java API (along with python) and the best way to submit web request to that API using Java is servlets. That's why many example are in servlets. I think.
Here's what i would do if I were you:
Setup tomcat. There are many options. So reply if you are not sure.
Deploy your handler servlet that'll use Google app engine Java API.
Send your image files to blobstore (not the servlet). See the tutorial. App engine will forward blob related information to the handler servlet you created in step 2.
Use Blobstoreservice in that servlet so that users can access that uploaded image.
Let us know if this helped.
I searched a lot regarding this topic but did not get any good answer.
Scenario:
We have Rest web service bases implementation in our project. Ideally frontEnd (Flex) call web service and backend send huge data point to frontEnd. Then frontEnd create chart of these data points and display to end user.
Our requirement is that user can export these charts and save as pdf file on the server. We are able to create JPG file from flex server and save as pdf file.
Problem occurs when end user has scheduled that chart report. Now that report can run at any time and may be browser is not opened at that time. So how backEnd will interact with frontEnd (flex) functions. Problems are:
browser is not opened so swf file is not loaded.
java/jsp need to interact with frontEnd(flex) as a reverseAjax so that frontEnd send JPG file back to server.
Does anybody face this issue before?
Is it somehow possible??
Asnwers/any leads are highly appreciated.
Please provide comments on this
Probably the only way to do this is to run a version of your Flex application (at least the charting part) on your server, and have your Java server interact with it.
I have faced a similar problem and have asked a similar question before. It is not very elegant, but what I mentioned before seems to be the only way to go.
I'm trying to write a simple Java desktop app to query Google and get the results. I've read so many articles in the past few days. I know that I have to do it through the GWT (Google Web Toolkit), the API that Google offers to programmatically query its search engine. My problem is that the GWT seems to be useful only to construct AJAX applications. I just want to write a simple desktop app. I am not interested in Javascript, XML or any server side application. Isn't there a way to do it?
Sure, take a look at this approach.
The general idea is that you make an HTTP fetch (using vanilla java.net.HttpUrlConnection or Apache HTTP Client). The magic is in the forming of the URL with the search term, and in the processing of what you get back from Google.
For the exact details on how to do this, see Google's REST search API documentation, including this section.
You can always get a license for the webservice and get the results returned through SOAP, however you did say that you were uninterested in XML. Shame, thats the quickest way. There is always doing a direct request to google through the query URL, since it uses HTTP get.