Giter Site home page Giter Site logo

Comments (10)

jontroncoso avatar jontroncoso commented on May 18, 2024

Hey there, tomsaffell. I am in need of this fix for a project I am working on, would you be able to share the code with me? You can find my email on my profile.

from videojs-youtube.

tomsaffell avatar tomsaffell commented on May 18, 2024

hi @OmniTool. You can find my fork here: https://github.com/tomsaffell/videojs-youtube
warning: it's pretty rough around the edges - I changed it to do specifically what we need, but I didnt ensure that I didnt break other use cases in the process. We use it in production.

To use:

player.src({type: 'video/youtube', src: 'https://www.youtube.com/watch?v=xxxxxxx'})

from videojs-youtube.

eXon avatar eXon commented on May 18, 2024

@tomsaffell I would like to fork back your work, this feature is missing and should be available. What's stopping you from making it ready to test right now?

from videojs-youtube.

tomsaffell avatar tomsaffell commented on May 18, 2024

@eXon I'm pretty sure I broke the original method for specifying the src. I wouldnt be hard to merge the two together, I just dont have the time right now, which is why I didnt submit a PR. You're very welcome to merge the two together. Do you need any info from me to do that?

from videojs-youtube.

eXon avatar eXon commented on May 18, 2024

I will probably just take your code and rewrite it inside my branch. I'm having trouble because the loadVideoById doesn't seem to work inside the videojs.Youtube.prototype.src. What HTML code are you using to test this?

Also, any reason why you are forcing the YouTube controls on Android and iOS?

from videojs-youtube.

tomsaffell avatar tomsaffell commented on May 18, 2024

Yeah, manually merging them is probably the best option. You can see a working example here:
http://tcsdev.www.videopixie.com/st/dev/vjs4.3.html which will show how we're setting up VJS and calling it.

Also, any reason why you are forcing the YouTube controls on Android and iOS?

Because my test indicated that on iOS (and some versions of Android) the browser would render YT's controls no matter what I did (causing double controls), so I defaulted it to not show the VJS controls in that case. Related to this: VJS has some issues around when to show controls, especially when switching techs. The state variables that determine whether the controls should be shown are messed up when switching techs. Try switching techs in the example above and you'll see it mostly works, but it is possible to occasionally get double controls.

the loadVideoById doesn't seem to work inside the videojs.Youtube.prototype.src

I dont understand this part, but hopefully the example will help. If not LMK.

from videojs-youtube.

mzaky avatar mzaky commented on May 18, 2024

Hi all,

could someone help:

function loadVideo(playerUrl, offset) {

var ytURL = playerUrl.split('?')[0];
var vtype = 'video/youtube';
//document.getElementById('v1').innerHTML = html.join('');
// declare object for video

     var player;

     videojs('vid1',{
        techOrder:['html5', "flash", "youtube", 'vimeo'],    
     },function(){ 

        //console.log(' -> VideoJS ready for id: ');
        player = this;
     });

     player.src({
           type: vtype,
           src: ytURL
        }); 

}

if I call this function through, i don't get the video updated:
loadVideo(playerUrl, true)

from videojs-youtube.

ulisesrmzroche avatar ulisesrmzroche commented on May 18, 2024

@eXon, @tomsaffell , so, what's up with this feature? I'd like to use this today. I can finish the rest of it if ya'll want.

from videojs-youtube.

eXon avatar eXon commented on May 18, 2024

@ulisesrmzroche @mzaky @tomsaffell @OmniTool Now this should work. Let me know if you see any bug.

from videojs-youtube.

ulisesrmzroche avatar ulisesrmzroche commented on May 18, 2024

@eXon, nice! This is shaping up to be a great morning.

from videojs-youtube.

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.