Hide controls - use play / pause - video.js

Is there a way when you hide controls and still be able to pause / play video ?
I've seen that when controls are visible the player works fine and reported no other problem.
I tried to find an answer on docs but no luck. So is there a way to do this ?
Many thanks and great work here!

Video.js works like the html5 video video element, where if you turn off controls the only way to control the video is through the API. The easiest way to set up what I think you're talking about would be to do the following.
videojs('my_video_id').on('click', function(){
if (this.paused()) {
this.play();
} else {
this.pause();
}
});

Related

Skip videos in youtube using Selenium

My question is like there are 10 videos running one after another in youtube , some of the videos get the "Skip video" option while other's just don't. Now how can I skip the videos which get the option of skipping and just run the other one's as it is. Also youtube uses flash so what api do I need to use for automating it? Thanks
Note : This is an idea which you would have to code. Please don't hesitate.
if(<skip button is available>) {
click Skip button
}
WebElement skipButton = driver.findElement(<locator>);
If(skipButton.isDisplayed())
{
skipButton.click();
}

Unsubscribe my own video in opentok

Hi I am using opentok.
When I say
publisher = OT.initPublisher();
session.publish(publisher);
My own video is visible to myself. I want to see only other participants video but not my own. I want my video to be visible to everyone else in the session except me.
How to make this possible.
And can I make other people video to full-screen?
Please help...
You can try this...
var publisher = OT.initPublisher('myPublisherDiv', {display: 'none'});
session.publish(publisher);
Or you can explicitly check on the video using firebug or chrome dev tool and see if it has an existing class or id, then you can just add in a display none on the class ex.
.video-class{
display:none
}

idangerous swiper prevents HTML5 play button working in ie10

I have an embedded HTML5 video which works fine in all browsers (or fails gracefully, if the browser is old or lacks video support). But since my site uses iDangerous Swiper (http://www.idangero.us/sliders/swiper/api.php), the custom video controls - the 'play/pause' button - does not work in Internet Explorer 10.
If I remove the swiper js code embed from the head area of my HTML, the embedded video plays fine in ie10. The problem seems to be that Swiper is intercepting the click on the play button in ie10 - and therefore the solution seems to be to disable Swiper for at least that small area of the page.
But it's not clear how to do it.
There seems to be a very scantly documented new feature in the June 2013 Swiper release which lets one create a 'noSwiping' class, but wrapping the video in a div with this class does not solve the ie10 problem.
Has anyone else needed to disable Swiper for an element and succeeded in doing so, particularly regarding ie...? I would be very glad to see a code example. My own project is still on localhost.
All you have to do is to add the html5=1 in the src attribute of the iframe :
The video will be displayed as HTML5 if available, or fallback into flash player.
you can read this:
Force HTML5 youtube video
I had a problem with a embed video of youtube inside a dangerous swiper, but the solution of TSL works for me!
I had added the html5=1 and solve my problem!
thanks!

Html5 Video. After 20 secs of pause reset player

So im working on a school project for a museum, we are making an info screen with a video to play for the visitors, ill like to make a function so that if one visitor is pausing the video and leave it will reset after 20 sec or so. So the next visitor dont have to reset the video by him self.
Any easy way to do that?
I just use the standard html5 video player and controls.
http://blog.teamtreehouse.com/building-custom-controls-for-html5-videos
it might help
probably you need to write your required code within
if (video.paused == true)
{
//find out code to find whether its been paused for 20 second.....may be use some timer control to get this
if(20secPaused)
{
video.currentTime = time;
}
hope it helps :)
I got help on a danish forum
a guy made an example i could modify for my own project it worked for me
the solution:
http://netkoder.dk/test/test0221.html

Specify Quality for Youtube Chromeless Player not working?

I'm developing with the Youtube Chromeless player.
My player size is 400 x 225px.
By default, Youtube sets videos quality at a "small" level with these dimensions.
Yet, as videos with "small" quality look ugly, I would like to upgrade them to the "medium" quality level.
This is my code:
ytplayer.loadVideoById(youtube_id, start, "medium");
Unfortunately, it does not seem to work... When I do some inspection on my console:
ytplayer.getPlaybackQuality();
"small"
Is someone experiencing the same issues with the Youtube API? If not, how do you specify the quality of your Youtube videos?
====== Edit =======
I've realized that once the video has started, the setPlaybackQuality function works. Therefore, I tried the hack below. It's perfectly working but would rather find another solution...
ytplayer.loadVideoById(YOUTUBE_ID, START);
setTimeout(function(){
// If medium quality available
if(ytplayer.getAvailableQualityLevels().indexOf("medium") != -1){
ytplayer.setPlaybackQuality("medium");
}
},1000)
Thanks a lot,
Dam
Ok I finally managed to solve this problem.
I did a different hack but way less ugly. Here it is:
function onYoutubePlayerReady(playerId){
[...]
// Add event listener to monitor quality
ytplayer.addEventListener("onPlaybackQualityChange","onQualityChange");
// Triggers the video
ytplayer.loadVideoById(youtube_id, start, "medium");
[...]
}
And this is the event listener in charge of forcing the videos quality to "medium"
function onQualityChange(qualityState){
if(qualityState != "medium" && ytplayer.getAvailableQualityLevels().indexOf("medium") != -1){
ytplayer.setPlaybackQuality("medium");
}
}
Now works like a charm.
If you have any suggestion, please let me know.