Giter Site home page Giter Site logo

Comments (7)

GordanRatkovic avatar GordanRatkovic commented on May 22, 2024 3

Any progress on this? I noticed you have an active branch for the mute-toggle feature.

from iphone-inline-video.

fregante avatar fregante commented on May 22, 2024

Last week I started some work to do exactly that, but it's not finished yet and I don't remember how well it worked: https://github.com/bfred-it/iphone-inline-video/tree/mute-toggle-test

For now you'll just have to have to separate <video> elements, one muted and the other one to replace it with

from iphone-inline-video.

giannoudak avatar giannoudak commented on May 22, 2024

At first thanks for your immediate reply! this was really helpfull!

For your workaround you mention with two <video> elements, how they can be synchronized? As far i understand, say that we autoplay muted the one video, and with click on a sound button we trigger play for the other video on the first's currentTime. I'm on the right direction?

Also, actually do you have an estimation on that branch completion?

from iphone-inline-video.

fregante avatar fregante commented on May 22, 2024

Something like this:

    //audioVideo.load() // not necessary, but may make the jump faster
    mutedVideo.onclick = function () {
        audioVideo.currentTime = mutedVideo.currentTime;
        mutedVideo.pause();
        audioVideo.play();
    }

This is probably going to take a bit to actually start playing, but maybe you can jumpstart that with the first line.

Not sure about when I can look into that, it's unlikely to be done before the end of next week.

from iphone-inline-video.

reidblomquist avatar reidblomquist commented on May 22, 2024

+1 would love to see this feature added

from iphone-inline-video.

windchime18 avatar windchime18 commented on May 22, 2024

i think playing two videos simultaneously is not possible depending on the iOS version. I have also tried it and it worked on iOS9 but not on iOS10 Playing multiple videos side by side iOS #92

from iphone-inline-video.

windchime18 avatar windchime18 commented on May 22, 2024

I think i have found a possible work around on this problem. you can use this code
you should have a two videos. then a button to activate the function enable the 2nd video with sounds.

var video = document.getElementById("video_without_audio"); 
var myVideo = document.getElementById("video_with_audio");

function enableSound() {
    myVideo.load();
    myVideo.play();
    myVideo.pause();
    video.pause();
    $("#video_without_audio").css("display", "none");
    $("#video_with_audio").css("display", "block");
}

myVideo.addEventListener("canplay", function() {
// console.log(" canplay: before = " + myVideo.currentTime);
myVideo.currentTime = video.currentTime;
// console.log(" canplay: after = " + myVideo.currentTime);

if( myVideo.currentTime < 1 ) {
	myVideo.play();
}
else {
	setTimeout(checkStarted, 500);
}
    
}, false);

function checkStarted()
{ 
console.log("check started");
   myVideo.play();
}

from iphone-inline-video.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.