I am writing a java class where i have some video URLs . I want to check if the video is played or not . In other words i just need to validate the video URL
I have heard we can use Selenium for this but i have no idea.
Thanks in Advance
If your video is playing using html5 tag and are using selenium then you can check that as following:
driver.findElement(by.xpath("Video element")).getAttribute("currentTime");
if it is greater than 0 that means those many seconds of playback o/w:
driver.findElement(by.xpath("Video element")).getAttribute("ended");
will show if playback has ended.
Selenium is a web driver that works by inspecting the DOM and interacting with the browser so I am assuming your java class ends up generating a web page.
I've never tried to interact with a video player before but assuming you are using html5 for your player you should be able to play the video by getting the play button element from the page and actioning a click on it. To verify that it actually plays you could wait a few seconds then verify via the progress bar that the current point in the video is past the 0:00 moment.
The above said, if these videos are external URLs you should avoid testing them, your testing should refrain to what is within the scope of your application, IE check that a video player is on the page, and confirm that it points at the expected link, but not that external resources are available (IE that a random video is still available on YouTube).
Related
Please, is there any way to force WebView to play html5 embedded vids? I spent two days tempting it (from just enabling js and plugins with hardware acceleration to using html5webview class) and made video tag working, but embedding with iframe only shows me preview.
Any suggestions, please?
Does it play if you click on it manually? There are all sorts of things that may go wrong with HTML5 video on the internet, on Android you also have to take into account the various permissions.
Try this first:
Load the webpage in a browser - does it work?
Load the webpage in the browser on the device, does it work?
Load the webpage in the webview, does it play when you click on it?
There should be an auto play property on the webview, but I know that one IOS at least that one is ignore and the video won't play until you click it.
Is there a way to embed a YouTube video with JavaFX 2 without a WebView? And if using a WebView is the only viable option, how can I detect when a video started and ended?
Is there a way to embed a YouTube video with JavaFX 2 without a WebView?
Technically, probably yes, but legally no as that would require using a video player other than the YouTube video player, which would violate YouTube's current terms of service.
If instead, you embed a player in JavaFX using a WebView to display YouTube's HTML5 embedded player, then that is ok with the YouTube terms of service agreement.
how can I detect when a video started and ended?
Use the YouTube JavaScript API to monitor playback status.
In Android/Java, Is there any code example to capture the screenshot of a computer with good frames per second programatically and create video?
I'd like a tutorial or full source code to do this. I'd like the program to work with and without the device having been "rooted".
There is app in the play store called Screencast Video Recorder that does this. But you need to ROOT the device for it to work, so I know it can be done.
What's the best way to capture android screenshot and create a video programmatically on a non-rooted device?
There is an app called Telecine that is open source that allows you to record screens - the code can be found at https://github.com/JakeWharton/Telecine. All credit is to Jake Wharton.
If you need an example, you can find one at Commonsware's github page - Mark Murphy has provided a sample app for both screen capture and screen recording using the MediaProjection APIs.
you can capture the screen via using DDMS as adb runs and has permission to the framebuffer:
follow this link for more details :
http://thetechjournal.com/electronics/android/how-to-capture-screenshots-and-record-video-on-android-device.xhtml
ALSO
check this links may be get some ideas about what you need :
http://answers.oreilly.com/topic/951-how-to-capture-video-of-the-screen-on-android/
http://www.mightypocket.com/2010/09/installing-android-screenshots-screen-capture-screen-cast-for-windows/
and check this project :
http://sourceforge.net/projects/ashot/
hope this help .
Check the following link
https://code.google.com/p/java-remote-control/
in this project the owner has created a java remote control i.e. he has captured the images from the remote computer and transfer to server and convert it to movies with different format all you need to understand what he has done and implement the same for all your needs. you can access the full source code with SVN client from the following URL
http://java-remote-control.googlecode.com/svn/trunk/
Also you can look for the Remote class in java which provides createScreenCapture method
As of Android 4.4, there is a screen recording feature accessible via adb.
http://developer.android.com/tools/help/adb.html#screenrecord
The screenrecord command is a shell utility for recording the display of devices running Android 4.4 (API level 19) and higher. The utility records screen activity to an MPEG-4 file, which you can then download and use as part of a video presentation. This utility is useful for developers who want to create promotional or training videos without using a separate recording device.
Try this application from the market
https://play.google.com/store/apps/details?id=com.ms.screencastfree
** Does not work on Galaxy Nexus or Tegra 2/3 yet **
EDIT 28/11/2014
Lollipop has been released and provides a new Screen recording API
http://developer.android.com/about/versions/android-5.0.html#UI
Screen capturing and sharing
Android 5.0 lets you add screen capturing and screen sharing
capabilities to your app with the new android.media.projection APIs.
This functionality is useful, for example, if you want to enable
screen sharing in a video conferencing app.
The new createVirtualDisplay() method allows your app to capture the
contents of the main screen (the default display) into a Surface
object, which your app can then send across the network. The API only
allows capturing non-secure screen content, and not system audio. To
begin screen capturing, your app must first request the user’s
permission by launching a screen capture dialog using an Intent
obtained through the createScreenCaptureIntent() method.
For an example of how to use the new APIs, see the MediaProjectionDemo
class in the sample project.
I'm working on a web project, where a user can share his screen and the output of his sound card with other users. I've come pretty far with the Adobe LCCS service (http://www.adobe.com/devnet/flashplatform/services/collaboration.html), but the screen sharing isn't stable enough to transmit a running video from the user's computer - it stops every 2 seconds.
It seems the only other way is to use a Java Applet. There are several libraries to share the screen. I'm looking for a way to capture the screen contents and stream it via RTMP to a server.
I have found a Java Applet, which captures screen shots of a defined area in a certain interval, encodes it into the ScreenVideo codec and streams it to an RTMP capable server: http://code.google.com/p/red5-screenshare/
I trying to write web application that recieves audio files from database and play them.Do you know any open source flash audio player for that?And i am also thinking implementing in java do you suggest java or another programming language for that?
Sorry to be facetious but did you even try a Google search?
First result: http://musicplayer.sourceforge.net/
In the not-too-distant future you'll be able to use the HTML <audio> element to play files, too. Firefox 3.5 and Chrome already support it.