I create a App with Ionic which embed the twitch player for streams and clips.
var url = https://player.twitch.tv/?video=v${videoId}&time=${time}&parent=localhost
<iframe [src]='url' frameborder='0' allow='autoplay; encrypted-media' allowfullscreen></iframe>
On Android its working perfect but in the iOS App the iframe will not be shown and no player is available. Just a white screen.
Does anybody know what the problem can be related to ios?
I have the same issue. Security limitations are the culprit indeed: I opened the Safari console while the iframe was trying to load and saw this error:
Refused to load https://player.twitch.tv/?channel=...&controls=false&parent=localhost&muted=true because it does not appear in the frame-ancestors directive of the Content Security Policy.
Looking at this security header that Twitch returns, it looks like this:
Content-Security-Policy: frame-ancestors http://localhost:* https://localhost:*
However, when using the Ionic WebView, according to its documentation:
iosScheme
<preference name="iosScheme" value="httpsionic" />
Default value is ionic
Configures the Scheme the app uses to load the content.
Values like http, https or file are not valid and will use default value instead.
So your WKWebView will have ionic://locahost as its application URL by default, which doesn't match the http://localhost and https://localhost prefixes specified by Twitch.
I tried using &parent=ionic://localhost in the Twitch iframe URL. The WKWebView doesn't refuse to open the iframe, but Twitch itself freaks out about the special characters in that parameter and refuses to render its player page.
To me it seems that currently, iOS Ionic/Cordova Apps and Twitch iframes are mutually exclusive.
Edit:
I found a bunch of discussions in the Twitch forum talking about this subject (1, 2), but none of them went technically in-depth to the point where a working solution or workaround could be found. Unfortunately, threads are closed after 1 month of inactivity, so I had to open yet another thread in the Twitch forum explaining the technical details from my point of view. I also added a feature request in their user-voice feedback portal. I'm afraid trying to make Twitch realise / accept that they should do something about mobile embeds is all we can do at this point. Here's the link to it:
https://twitch.uservoice.com/forums/310213-developers/suggestions/44682766-make-embeds-work-on-ios-web-based-apps-like-ionic
I saw this site http://www.rainymood.com where you can add the youtube link in the url , by example rainymood.com/watch?v=0gcu3GI3nA4 and it will embed the video on the site .My question is how can you do that .I mean , for example I have www.mysite.com and I want to embed a youtube video based on my url like so : www.mysite.com/watch?v=0gcu3GI3nA4 and then show it on the site .I hope you can understand me :)
Edit : What I use is this : http://www.w3lessons.info/2012/01/04/fetch-embed-videos-from-url-using-php-and-jquery/ .What i need now is instead entering the url in the form ,the video to be embed using my url with the /watch?v=id ending .
How do I launch the Youtube app in Windows Phone 8 without going to the browser. Basically I am currently using the following code and it takes me to the default browser instead of opening up the Youtube app:
Dim webBrowserTask As New WebBrowserTask()
webBrowserTask.Uri = New Uri("http://www.youtube.com/embed/3aP3KBsh3Y8",UriKind.Absolute)
webBrowserTask.Show()
I want to be able to launch the Youtube app directly. So far I haven't been able to come up with a solution.
There is a slightly better way. Use WebBrowserTask but give it URL in this format
String.Format("vnd.youtube:{0}?vndapp=youtube",youTubeId)
where youTubeId is the ID of the youtube video (3aP3KBsh3Y8 in your case)
I'm attempting to embed a Youtube video on a user's wall using the Javascript API. I've poured over a bunch of different tutorials and came up with this:
var data = {
method: 'feed',
link: current_video_url, // Link to the vide on our site
source: current_video_src, // Link to the Youtube video, http://youtube.com/v/[hash]
picture: current_picture_url, // Thumbnail from youtube
title: current_video_title, // Title from our page
caption: current_video_description // Text from our page
}
FB.ui(data);
Running the Facebook Debugger shows that the current_video_url link is being properly parsed for OG tags and is available as an embedded video. I ran a debugger and all the variables are being properly set in the data variable.
This worked fine for about 2 days, and then we pushed the site live. We set up a new AppID in Facebook but now all the videos are just thumbnails instead of being embedded in the user's wall. I thought maybe this is a problem with the live site but now the dev site is broken too.
What's the best way to get this to work consistently?
I have a video URL like http://www.youtube.com/watch?v=AAAAAAAAAA
How can I get a RTSP URL for this video?
EDIT: Seems like Youtube stopped supporting this method.
Go to:
http://gdata.youtube.com/feeds/api/videos/{video-id}
For example:
If we want to get the RTSP link for this video:
https://www.youtube.com/watch?v=rUDm2xatms4&list=PLA9nd26sR8HD62LClHOBU93tuDKnJsfKa&feature=player_detailpage#t=0
We'd use:
http://gdata.youtube.com/feeds/api/videos/rUDm2xatms4
This will download an XML file for you. In there search for 'rtsp' and you'll get the full link.
Hope this helps.
Go to this link, and Replace "VIDEOID" with the actual ID of the video you want:
http://m.youtube.com/add_favorite?v=VIDEOID
then right click the image of the video, and copy the link.
For example, if the video is http://youtube.com/watch?v=ABCDEFGHIJK, you would request http://m.youtube.com/add_favorite?v=ABCDEFGHIJK
The link is affectively permanent, but it will vary depending upon whether or not you are logged in and what preferences you have set when you request the page.
I made a javascript function that can give you the rtsp of any youtube video, you just have to set the original youtube url as param. Maybe it is what you are looking for.
Here's the github link. Hope this helps!
Or you can always follow this simple 45 second video tutorial. And it will show you how to get the RTSP from any youtube video also.
Use the below format and replace VIDEO_ID with your VIDEO's ID.
To view the same in android(chrome) enable "Request desktop site".
For more details see this article.
m.youtube.com/watch?v=VIDEO_ID&app=m&itct=CIYBEKQwGAAiEwjYqrOwmabLAhWII74KHWhnDt8yCmctaGlnaC1yY2g%3D&hl=en&client=mv-google
According to my experience.
1) Browse the video.The url wud look like this
http://www.youtube.com/watch?v=oHRpGg2_Yqs
2) After replacement of www with m
http://m.youtube.com/watch?v=oHRpGg2_Yqs
3) Right click on the image now loaded in the browser during step 2 (dat wud be the rtsp addr)
I have an old BlackBerry Bold 9900, and when using the stock web browser on the YouTube website and play a video, it plays via rstp (in the browser), so I can just go and copy the url out of the url bar. That's probably kind of an inconvenient method of finding it, but it works. Maybe if you changed your user agent to that of an old BlackBerry (mine is on os 6.x.x)?
Hope this is useful,
jBit
EDIT: Just figured out how to do this.
1. Install user agent switcher chrome extension here
2. Open it and go to "options"
3. Click the big green "New User-Agent" button
4. Put "Blackberry" in the name field
5. Paste this into the user-agent field: headers: 'User-Agent: BlackBerry9800/6.6.0.207 Profile/MIDP-2.0 Configuration/CLDC-1.1/UCWEB8.1.0.104/161/999'
result: { browser: { name: 'UC Browser', version: '8.1', type: browser }, engine: { name: Gecko }, os: { name: 'BlackBerry OS', version: '6.6' }, device: { type: mobile, subtype: smart, manufacturer: RIM, model: 'BlackBerry Torch 9800' } }
readable: 'UC Browser 8.1 on a RIM BlackBerry Torch 9800 running BlackBerry OS 6.6'
6. Press save
7. Go to youtube; notice the much older ui
8. Search for a video of your choice and click on it
9. There will be a box with a video thumbnail underneath which there will be a "Watch video" hyperlink
10. Right-click it and press "copy link address"
11. You now have a streamable rtsp link
12. Profit!