Comments (10)
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.
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.
@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.
@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.
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.
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.
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.
@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.
@ulisesrmzroche @mzaky @tomsaffell @OmniTool Now this should work. Let me know if you see any bug.
from videojs-youtube.
@eXon, nice! This is shaping up to be a great morning.
from videojs-youtube.
Related Issues (20)
- Not working with newer versions of video.js HOT 2
- Youtube live video freeze the computer and Chrome
- Remove video-setup and add source via JS
- there's no canplay or canplaythrough for Youtube?
- Unexpected token in example HOT 2
- Full example? HOT 2
- onended function not working on YouTube embed HOT 1
- `videojs.extend` has been deprecated HOT 3
- unmet peer video.js@"5.x || 6.x || 7.x": found 8.0.4
- Dual package hazard on video.js and videojs-youtube ? Doesn't work with CDNs direct import in browsers- both jsdelvr and esm.sh
- `YT is not defined` in a small number of cases HOT 2
- How to play hls video HOT 4
- youtube shorts support HOT 1
- Subtitles are showing
- YouTube Ads not being shown
- Advert Preroll on iOS crashes. HOT 2
- Playlist won't work on mobile HOT 4
- Video Never Starts After Clicking Play Button During Buffering Before Cue Completion
- missing mute playerVar for autoplay HOT 2
- vjs play /button loses binding when player moved in the DOM
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 videojs-youtube.