loadVideoById() caches properties when loading same video - youtube-api

It seems like YT IFrame API will cache properties when using loadVideoById (cueVideoById too) and loading the same video in but with different properties. So if I load a video in with endSeconds at 10, and then load the same video in but with endSeconds at 25, it will still end at 10.
Here's a plunker to demonstrate this:
http://plnkr.co/edit/YnVmod?p=preview
Is this a known issue? Any workarounds? I am working on an app that will most likely see this kind of behavior, and so far the only solution, as far as I know, is to re-initialize the player but it's out of the question for me.
EDIT:
Looks like it's known, with a bug filed at https://code.google.com/p/gdata-issues/issues/detail?id=5010

Related

Force embedded youtube video to HD 5K (2020)

I have tried to embed a video with the parameter: vq=hd2880.
And it does not work. By default it is always "Automatic: 720".
I have tried different values.
The src of iframe:
https://www.youtube.com/embed/[code]?vq=hd1080
https://www.youtube.com/embed/[code]?vq=hd1440 (HD)
https://www.youtube.com/embed/[code]?vq=hd2160 (4K)
https://www.youtube.com/embed/[code]?vq=hd2880 (5K)
It does not work.
Regarding mobile devices: Described in the YouTube documentation, they do not support forcing the quality anymore. I hope anyone comes up with a solution, but for now you cannot change it. See https://support.google.com/youtube/answer/91449 for more info.
edit; I know this is not the answer you wanted of course. We are going to implement Plyr to overcome these issues. Maybe this can help you too.

Play video (from streaming) in iPhone with Ionic 3/Cordova iOS app from Node Js, without so much time loading

First, sorry because this is not an special code issue (I can play videos in iPhone), so I'm not attaching any of my code, but asking for technical solution.
I'm developing a mobile applicaton (and also a webapp) that plays videos which come from a Nde js server. At first I noticed that in Safari, you can only play videos from streaming (which is also the best practice in the rest of the browsers), but it was very slow (so much time loading the video).
I came accross this piece of code, and the post of the author, it helped me to improve my server side streaming code:
https://github.com/davidgatti/How-to-Stream-Movies-using-NodeJS/blob/master/routes/video.js
I didn't need to change anything in the webapp, but now I can play videos much faster in Mac/Safari (in HTML5 I have simple tags).
But nothing changed in the Ionic app... And I don't know how to follow or where the problem could be (ionic/cordova or Node JS).
What can be the point I can be missing? Any link, known bug in ionic, or trick would help a lot.
UPDATE:
I'm trying with .mov and .mp4 video files. What's the ideal format (or compression) for iPhone?
UPDATE 2:
It's a good choice to handle videos with a cloud video solution like uStream, and embed it like an iframe (as provided solution from ustream)? Nothing more seem to work on improving time of load, managing videos on my own server and ionic client.
Thanks so much

What are the reasons behind the scenes that make self hosted videos not run on mobile

With the risk to get some down votes here for not offering concise code here, I try to ask this question here. Googling does not help at all. One finds a bunch of sites advising you to NOT self host videos on your webpage (wether wordpress or static). Ok but that’s not my point. If you have to? (maybe some client asks you to do it)
I tried as an example tons of plugins (video players) for wordpress for a self hosted video which works very fine (with several file options delivered) on all current browsers but it won’t run on mobile, i.g. iPad and others. It is displayed but I cannot play it.
And I cannot get an answer why? Can this be due to the video itself? Some encoding secrets? I tried .mp4 .webm and some others. No success.
Any help, any hint here would be so awesome!
Ok. It is the video in itself not the embedding into the page that creates problems: I found this link very helpful:
https://www.broken-links.com/2010/07/30/encoding-video-for-android/
In “Handbrake” there are also many presets and stuff for iPad etc.
Sorry for not having done sufficient research before!

Why does youtube video work everywhere but other video sources no?

So this will sound like a stupid question, but I notice that video from youtube works on pretty much all browsers without any setup work. However, use a security DVR or a IP camera, and suddenly you need a custom applet that is OS specific added to run it. Why does youtube just work everywhere? Because all the browser makers set it up by default? If the youtube video presentation method is so universal, why does not every video device use the same method/plugin as youtube?
Thanks.
YouTube doesn't "just" work everywhere. They have hundreds of engineers working to keep it working everywhere. They have several copies of each video that work on a sub set of platforms, and spend a lot of time making sure each platform works and continues to work.

YouTube embed code on iPad

I'm working on improving the experience of a site by adding in iPad support. This includes support for videos. Our client is pushing towards a YouTube model for storing and serving videos -- great for us! I originally planned to implement the use of YouTube's new HTML5-supporting <iframe> snippets. This offloads the device detection to YouTube and makes embedding a video a cinch as we don't need to worry about compatibility. It turns out the the CMS we're using, Sitecore CMS, strips out <iframe>'s from our WYSIWYG editor. After a lot of research it looks like its a bit hard to not make this happen.
Fast forward to now... I tested out the old style <embed> code and discovered even though iOS doesn't support Flash, these embeds seem to work fine on iPad. Some Stack Overflow research led me to this post which suggests its because of the YouTube plugin /System/Library/Internet Plug-Ins/YouTubePlugIn.webplugin on iPads that allows for the playback.
My question is, is there any documentation that this is the exact reason? I'd like to go by this as why we can use the regular <embed> code but I need to back it up with proof via a document for iOS. Is this YT plug-in on every iPad by default, or do users need to manually install it? This seems like a great solution considering our unfortunate incompatibility with an <iframe> but I need to support the use of the <embed>'s with hard facts. Thanks in advance.
The answer you are looking for is to be found in Apple's URL Scheme Reference. Basically it's a mechanism that comes into play on the iDevices to detect and handle specifically, certain types of URLs - for instance Google Maps, iTunes and also YouTube.
Here's a few reference links.
https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/Introduction/Introduction.html#//apple_ref/doc/uid/TP40007899
https://developer.apple.com/library/archive/featuredarticles/iPhoneURLScheme_Reference/YouTubeLinks/YouTubeLinks.html#//apple_ref/doc/uid/TP40007895-SW1
And just for good measure, you might also want to take a look at the Safari Developer Library for the best practice recommendations on HTML5 Video and Audio embedding :-)

Resources