I was wondering if it is possible to autoplay an embedded YouTube video AND also have the video start at a certain point?
Any help is appreciated.
You can just add the & to place another command in the embed script. The ? starts the first command, the & adds another. The Start command is in seconds: 1min10sec=70secs. Then just top it off with an autoplay=1 to automatically start playing.
<iframe src="https://www.youtube.com/embed/acktYyOGG6w?start=29&autoplay=1" width="1" height="1" src="" frameborder="0" allowfullscreen></iframe>
I ran into the same issue for deploying music for my church's website. The width and height were only to make it a pixel in size so the video won't show while it plays.
You see another example when you look at the playlist links.
https://www.youtube.com/watch?v=of9C-8azVh8&index=4&list=PLBjhJqE72NDQPMNhB0peXyjDQNVxSext-
Related
I've added embedded videos on my website's 'Video' section. A weird thing's happening, though. If I play the video, then 'X' out the window while the video's playing, the audio still plays even though the window is closed.
So it seems like "closing" my window doesn't really close the video. I've added "?enablejsapi=1" to the end of the YouTube URL to enable the YouTube API, but I'm not sure what my next step is.
How do I set up the iframe so the video stops playing when the modal window is closed/X'ed out?
Here's the code for that window + embedded iframe:
<article id="videos">
<h2 class="videos">Our Work</h2>
<iframe width="560" height="315" src="https://www.youtube.com/embed/973w2QTswQI?enablejsapi=1" frameborder="0" allowfullscreen></iframe>
<p>Adipiscing magna ...</p>
<p>Nullam et orci ...</p>
</article>
I don't think it's integrated in modals to stop vidoes when you press X. You have to explicitly include in the function that you want to stop the video using stopVideo command.
I have a youtube video in my website. Here is the code :
<iframe width="100%" height="100%" src="//www.youtube.com/embed/<?php echo $youtube_key; ?>?autoplay=0&showinfo=0&controls=0&modestbrandin=1&rel=0" frameborder="0" allowfullscreen>
I want that user can only see the video. I mean user can play it or pause it. No other control even I DON'T WANT user can right click on the video player.
Now this code invisible all option but user can right click and can copy the url :(
How can I implement this type of youtube in my website where user can only see it only from my website. any suggestion ?
I wanted to use a youtube video as a background for my website (mostly because of their bandwidth check and setting the video quality). When I try to autoplay and loop it though (via setting loop and autoplay parameters), I still have the circular loader there. Is there any chance to automatically start the video with no delays (even if it's going to be a bit laggy on the first load) and then just progress with the download, or should I just give up on it?
Thanks,
E.
E: iframe code here:
<iframe src="//www.youtube.com/embed/VID_ID?autoplay=1&loop=1&rel=0&playlist=VID_ID " frameborder="0" allowfullscreen></iframe>
I don't think it's possible to immediately start loading your video from YouTube. How about downloading it (I like to use http://www.convertfiles.com) and then using that? It'll probably be easier to customize your video options when you have it downloaded on your website.
My iOS application uses youtube iframe player on UIWebView to play any clip with inline mode. The following code is HTML code used.
<html>
<head>
<style type="text/css">body {background-color: transparent;color: white;}</style>
</head>
<body style="margin:0">
<iframe src="http://www.youtube.com/embed/e2w8z6mI47U?playsinline=1&rel=0&showinfo=0" width="320" height="240" frameborder="0" allowfullscreen></iframe>
</body>
</html>
Then, it is passed to loadHTMLString method.
That code had worked well until a recent date. But, I recently noticed that every clips I used aren't played normally. the standby view and play button is shown but, although I pushed the play button, it didn't play well. black screen was only shown.
I haven't found anything to solve the problem. Are there any changes of Youtube Iframe player or points I missed?
I ended up solving the problem by calling [videoView setMediaPlaybackRequiresUserAction:NO].
I don't exactly know why the method could save me. At a guess, there was a change dealing with the request for playing at youtube. I could find the following changes on youtube developer site.
January 28, 2014
The playsinline parameter controls whether videos play inline or
fullscreen in an HTML5 player on iOS. Setting the value to 1 causes
inline playback.
The Selecting content to play section has been updated to explain how
to find YouTube video IDs and playlist IDs using the YouTube Data API
(v3) rather than the older API version.
The controls parameter's definition has been updated to reflect the
fact that the parameter value only affects the time that the Flash
player actually loads in IFrame embeds. In addition, for IFrame
embeds, the parameter value also determines when the controls display
in the player. If you set the parameter's value to 2, then the
controls display and the Flash player loads after the user initiates
the video playback.
I guess that one of above changes may need extra informations which are passed from a client to youtube server for playing normally.
UPDATE:
Today, I identified that it works well without my solution. It seems that the problem was fixed lately.
My requirement is I do not want to show the video playing in full screen.
For that initially, I choose the MPMoviePlayerController. By using this static videos i.e, which is in our app are playing well but the YouTube videos i.e., contains URL are not playing, instead of that it shows blank screen.
I tried in these ways:- http://pastie.org/8484597 You may think that all the ways are same.. But I tried all the ways as I googled I got these are all the ways.
Later, I moved to UIWebView. Yes, it is absolutely good.. it is playing my videos with No Doubt. Here I am extracting the youtube id and playing. But here, I do not want to play the video in full view. But when I want to play the video we have to click on the UIWebView then instantly it is showing full screen with video playing. But, I want to play with in the web view only.
I followed this link but same problem.. Display video inside the Uiwebview not in device full screen
I tried in these ways.. http://pastie.org/8484621
(I used LBYouTubeExtractor also. it plays good but it is not playing all the videos. For some videos it throws _itemFailedToPlayToEnd error).
Please guide me how to do in UIWebView?.
Wrap the video within a html file and remember to add webkit-playsinline and change the webview attribute webview.allowsInlineMediaPlayback =YES; Then load the html file with the webview. This works for me.
The html file is like
<!DOCTYPE HTML>
<html>
<head>
</head>
<body>
<video
webkit-playsinline
src="prog_index.m3u8"
height="200" width="200"
type="video/m3u8"
>
</video>
</body>
</html>
Cheers!