youtube

Auto-Stop a YouTube Live Event if encoder crashes

泪湿孤枕 提交于 2020-01-04 05:46:16
问题 I know YouTube API v3, allows you to create new Live Events and then you need to bind broadcasts with streams, change the status manually, etc... in order for your live event to be published. But... I noticed that, when the remote encoder stops sending video to the stream, the Event keeps running. It will keep running until you manually stop the stream. I was wondering if there is any way to auto-stop the stream in the case my encoder crashes, or maybe I press the home button in the mobile

Youtube Video download in php using regex

∥☆過路亽.° 提交于 2020-01-04 05:34:30
问题 i am using following code for downloading youtube video. <?php header("Cache-Control: no-cache, must-revalidate"); // HTTP/1.1 header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past require_once('lib/youtube.lib.php'); if(preg_match('/youtube\.com/i',$_GET['url'])){ if(!preg_match('/www\./i',$_GET['url'])){ $_GET['url'] = str_replace('http://','http://www.',$_GET['url']); } list($video_id,$download_link) = get_youtube($_GET['url']);} else{ die('<span style="color:red;">Sorry,

YouTube embed code on iPad

落爺英雄遲暮 提交于 2020-01-04 03:55:09
问题 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

YouTube embed iframe not showing in Safari

依然范特西╮ 提交于 2020-01-04 02:51:07
问题 The link is http://thecodeclub.org/ and there is a YouTube video. Works fine in Chrome but the iframe remains blank in Safari? Has anyone else encountered this or have a fix? <div class="wrapper wrapper-style2"> <article id="work"> <header> <h2>What Most Schools Don't Teach</h2> <p>Even rap stars are learning to code...</p> </header> <div class="video-container"> <iframe width="560" height="315" src="https://www.youtube.com/embed/nKIu9yen5nc?rel=0" frameborder="0" allowfullscreen></iframe> <

Can YouTube be forced to play fullscreen by default on Android?

拈花ヽ惹草 提交于 2020-01-04 02:28:31
问题 The behaviour between YouTube embedded videos and Vimeo embedded videos appears to differ both from each other and across iOS/Android platforms. I'm displaying the videos within a lightbox provided by a wordpress plugin. The videos are embedded via an iframe which has the allowfullscreen attribute. On an iPhone (using Chrome browser), when the user presses play on either YouTube or Vimeo video, it automatically enters full screen mode. On an android phone (Samsung Galaxy S6, using Chrome

How to add a button to play YouTube video full screen using JavaScript?

六眼飞鱼酱① 提交于 2020-01-03 17:52:27
问题 I'm coding a Google Chrome extension where I embed a YouTube video: <iframe id="ytplayer" type="text/html" width="640" height="360" src="https://www.youtube.com/embed/M7lc1UVf-VE" frameborder="0" allowfullscreen> I then added a button below that should allow a user to click to play this video in full screen: <a href="#" id="lnkFullScreen">Play full screen</a> The work is done via JavaScript (and jQuery) using the code I found here: $("#lnkFullScreen").click(function(e) { e.stopPropagation();

“403 - usageLimits” on youtube api

我只是一个虾纸丫 提交于 2020-01-03 13:05:10
问题 I have this JSON response from my call from my android App to YouTube API: "error": { "errors": [ { "domain": "usageLimits", "reason": "ipRefererBlocked", "message": "There is a per-IP or per-Referer restriction configured on your API key and the request does not match these restrictions. Please use the Google Developers Console to update your API key configuration if request from this IP or referer should be allowed.", "extendedHelp": "https://console.developers.google.com" } ], "code": 403,

How to prevent YouTube js calls from slowing down page load

别来无恙 提交于 2020-01-03 07:13:22
问题 I am using https://gtmetrix.com to diagnose issues with my page speed. The page in question has one embedded YouTube video and GTMetrix is saying that this video's JS calls are slowing down page load speed. This is the call being made: <iframe width="640" height="360" src="https://www.youtube.com/embed/PgcokT0AWHo" frameborder="0" allowfullscreen></iframe> 回答1: EDIT: as of October 2019, this is not working anymore (Thanks to @CpnCrunch for the update). For the cases where it's not impacting

Regex to match Youtube URL's

こ雲淡風輕ζ 提交于 2020-01-03 06:40:23
问题 I am trying to validate a Youtube URL using regex: preg_match('~http://youtube.com/watch\?v=[a-zA-Z0-9-]+~', $videoLink) It kind of works, but it can match URL's that are malformed. For example, this will match ok: http://www.youtube.com/watch?v=Zu4WXiPRek But so will this: http://www.youtube.com/watch?v=Zu4WX£&P!ek And this wont: http://www.youtube.com/watch?v=!Zu4WX£&P4ek I think it's because of the + operator. It's matching what seems to be the first character after v= , when it needs to

How to avoid video stop when I scroll the screen using youtube API in an android app?

怎甘沉沦 提交于 2020-01-03 04:33:11
问题 I'm building an app for Android using the YouTube API. The video is in a scroll widget, and when I scroll and the video goes up or down the screen, it stops. I want the video to continue even though isn't in the screen. How can I do that? 回答1: i went through the same problem, i open this question: Android YouTube API video pause when rotate screen or hide player see the comments to understand better. For the tests I did, the Youtube API knows when the player is not showing on the screen and