I have videos in my fancybox. Is it possible to detect when slideshow has come to an end (so last video has finished)?
I have this code which detect start of last item, I could implement some code to detect video end, however I was wondering whether there is some quicker / more efficient way to detect fancybox slideshow finish?
afterShow: function(){
if(this.index == this.group.length - 1){
alert('I am the last item of the gallery');
}
}
Related
This question already has answers here:
How to make the script wait/sleep in a simple way in unity
(7 answers)
Closed 1 year ago.
I am creating an interactive video using Unity/C#. I am doing this using scenes and buttons that when clicked, go to the next scene or back. However, I want the buttons to appear once the video is finished. Is there any way I can add a delay to the buttons before they appear in the scene when playing?
For time delay you could use coroutines. Check it out here There is options like waitforseconds so you can delay your button apperance. here is sample code
private IEnumerator ShowBtn()
{
yield return new WaitWhile(() => videoplayer.isPlaying);
// show visibility of your button
}
And when you play video call this function like this
StartCoroutine(ShowBtn());
This should do the trick. isPlaying.
A simple script would look like this.
if(videoplayer.isPlaying == false && videoWasPlayed == true){
btn.active = true;
videoWasPlayed = false;
}
videoWasPlayed is used to check if the video was ever played. This would need to be set to true when the video is played.
I'm new to the Azure media player.
I would like for the big play button to appear whenever the video is paused. I can see the element in the html, just not sure how to make this happen.
Thanks!
I agree with #vince in the answer, But the Big play Button wont go away when we want to play the paused video
so here you should do the following
myPlayer = amp(id, playerOptions, function() {
console.log('Good to go!');
this.addEventListener('pause', function() {
jQuery(".vjs-big-play-button").show();
});
this.addEventListerner('play', function(){
jQuery(".vjs-big-play-button").hide();
});
});
Add this code on your pause event.
$(".vjs-big-play-button").show();
Let me know if it works.
hi i want to play a video and it pause after a fixed time like 3:12 mm at the same time i want to show one view to user where form is there and when user fill form and submit the button then again play the video.
My Suggestion is use two instance of videoPlayer object. so when pausing first one make it 2nd player to play the video.
And Please use hidden property.
I have a UIWebview which will play a YOUtube video playlist, and I need to handle the events when user click DONE button and close the webview.
So far, the working solution i found is to handle UIMoviePlayerControllerDidExitFullscreenNotification, but when UIWebview finish playing a video in the list it will exit the fullscreen mode and enter back to fullscreen mode to play the next one. My app handles the event of exiting fullscreen as pressing DONE button and only the first song of the list get played.
My question is that is there anyway to handle DONE button click events without handling UIMoviePlayerControllerDidExitFullscreenNotification, or to handle those two events separately?
I have lots of buttons on a web page. Depending on which one is clicked, I want to play a different video.
A large number of <video> elements doesn't seem to work particularly quickly or reliably.
So far, I have tried to:
Create and play() the video element dynamically, after an image is clicked:
var video = document.createElement('video');
video.src = 'video.mp4';
document.body.appendChild(video.play);
video.play();
This works on iOS 4, but not on iOS 3.
Create the video element before, and just change the src.
Doesn't work either.
It seems like the video object must have already done "it's thing", before it can be played.
Use window.open() to open the video URL.
This will cause an annoying new tab to open, which will remain open after playback has completed.
Set window.location
This will cause the current page to be reloaded after playback has completed, which I'm trying to avoid.
Any more ideas?