Comments (4)
Hi @binishprabhakar!
You can try modifying the isPlaying
function to go to the next page when it sees the flag that the video has ended. Something like this:
var isPlaying = function(slider) {
var vid = slider.$currentPage.find("video");
if (vid.length && typeof vid[0].pause !== "undefined") {
if (vid[0].ended) {
slider.gotoPage(slider.currentPage, true);
return false;
}
return !vid[0].paused && !vid[0].ended;
}
return false;
};
$(this.$el).anythingSlider({
// ...
isVideoPlaying: function(slider) {
return isPlaying(slider);
}
});
I quickly threw this together and didn't check the logic or functionality, so please bear that in mind.
from anythingslider.
@Mottie I have tried this method also. But getting maximum stack exceeded error.
app.js:19056 Uncaught RangeError: Maximum call stack size exceeded
at RegExp.exec ()
at Function.Sizzle [as find] (app.js:19056)
at jQuery.fn.init.find (app.js:21186)
at isPlaying (app.js:54647)
at Object.isVideoPlaying (app.js:54739)
at $.anythingSlider.base.gotoPage (app.js:31718)
at isPlaying (app.js:54650)
at Object.isVideoPlaying (app.js:54739)
at $.anythingSlider.base.gotoPage (app.js:31718)
at isPlaying (app.js:54650)
from anythingslider.
@Mottie I have come up with a solution , seems like issue has fixed.
onSlideComplete: function(slider) {
//playVideo(slider.$currentPage);
//check slider has video
var vid = slider.$currentPage.find("video");
if (vid.length) {
//vid[0].currentTime = 0;
vid[0].muted = true;
vid[0].play();
slider.clearTimer(true); // stop slideshow
var refreshId = setInterval(function() {
if (!isPlaying(slider.$currentPage)) {
slider.clearTimer(true); // stop slideshow
vid[0].muted = true;
vid[0].pause();
slider.gotoPage(slider.currentPage + 1, true);
slider.startStop(slider.playing, true);
clearInterval(refreshId);
}
}, 500);
} else {
slider.clearTimer(true); // stop slideshow
setTimeout(function() {
slider.gotoPage(slider.currentPage + 1, true);
slider.startStop(slider.playing, true); // restart slideshow
}, 10000);
}
},
But, it shows a transition between slide 1 to 2, if slider.gotoPage(slider.currentPage + 1, true); Do you have any idea about this or have any other suggestions.
from anythingslider.
Its fixed thank you ... @Mottie
from anythingslider.
Related Issues (20)
- FX demos aren't working HOT 2
- Slider height collapses by removing height from container class HOT 4
- Video demo doesn't work HOT 3
- Can't just use CSS HOT 2
- html5 video slider issue HOT 2
- Photos are being rotated HOT 4
- resizeContents false does not leave division at constant height HOT 6
- Metallic.css breaks slide show button HOT 2
- iframe not scrolling on iPad HOT 2
- Play button not Visible on IPad HOT 3
- jQuery .data() values are lost in cloned elements HOT 4
- JW Player is not working HOT 2
- Loading issue HOT 4
- undefined error when infiniteSlides = false and showMultiple = X HOT 2
- Can't get slider working... HOT 2
- Single Video playing issue HOT 3
- jQuery 3 compatibility
- issue with window.location HOT 1
- Image stacking when using https:// HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anythingslider.