I would like to launch directly to the YouTube player on Windows Phone 7.
I tried using WebBrowserTask and giving a YouTube URL, it opens up the browser and brings me to a page with a thumbnail of the YouTube video, I need to click on the thumbnail before the video plays.
I like to skip the extra click. I like the user to click a button in my app, and it should play the video directly. Is there a way to do it?
Once you have the Youtube app installed, from within you application you can start the WebBrowserTask and do the follwing:
Regex Youtube = new Regex("youtu(?:\\.be|be\\.com)/(?:.*v(?:/|=)|(?:.*/)?)([a-zA-Z0-9-_]+)");
Match youtubeMatch = Youtube.Match(YOUTUBE_VIDEO_URL);
string id = string.Empty;
if (youtubeMatch.Success)
id = youtubeMatch.Groups[1].Value;
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.URL = "vnd.youtube:"+ id +"?vndapp=youtube_mobile";
webBrowserTask.Show();
That should launch the browser, then automatically launch the Youtube App. Cheers!
Finally I've worked out a clean solution (without browser task, and no "double back key pressing"):
http://mytoolkit.codeplex.com/wikipage?title=YouTube
Try to use following sample;
WebBrowserTask webBrowserTask = new WebBrowserTask();
webBrowserTask.Uri = new Uri("http://www.youtube.com/embed/V3oJR5IAMxM?autoplay=1");
webBrowserTask.Show();
this should open video directly, but I think you will have to still double click to go back.
There is a solution for that now. You can use vnd.youtube protocol to launch the YouTube application from Microsoft and play.
C#
Windows.System.Launcher.LaunchUriAsync(
new System.Uri("vnd.youtube:9bZkp7q19f0")
);
Unfortunately Launcher.LaunchUriAsync method only works with Windows Phone 8 devices and beyond.
No. Mabe in next version of OS will be custom choosers and lunchers.
To display a video from YouTube, you will need the Video Player for YouTube. Otherwise, you will need to write a custom decoder that will receive the YouTube stream and display it in a MediaElement.
As you've discovered this isn't currently possible.
There is currently no way to launch another application, other than by using a Launcher or Chooser.
On the YouTube site, individual videos can be configured to autoplay or not. I'm not aware of a way to override this.
However, on the phone this is different. YouTube uses flash to play videos but Flash is not currently supported on the phone. YouTube videos can only be played if the YouTube application is installed. When you open the youtube site with the webbrowsertask the user must click on the image to launch the player.
If web pages were able to launch applications without first requiring user action this could be a huge security issue.
N.B. The YouTube app has special elevated privileges, not generally available, to be able to be launched in the way it is.
Related
I have a working "Action On Google" that we programmed.
I separately created a website that Chromecasts video (based on Google's sample code).
However, what I would REALLY like to have is speak to my Google Home, then automatically have content (ideally an image + audio, then a video right after) cast to the Chromecast.
Is this technically possible exclusively through the Google Home interaction?
Alternately, is there a way to cast image + audio at the same time through a website (and what code do I need to do so)?
Right there is no API for third-party developers to programmatically send content to a Chromecast.
I tired to googling that how share videos form camera roll in windows phone 8 like in Nokia video upload and facebook app. I used to try this
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967563(v=vs.105).aspx
Only share picture but I want to share only videos for my app e.g. when my app show in list when share a video by camera roll of windows phone in sharing
To quote the link you included in your question:
Note that this extensibility is only available when the photo is a JPG
file.
And from my experience, I can confirm that it is not possible to register your app as a share target for a video file.
In other words, if a user tries to share a video from the camera roll or another app, there is no way to make your app appear as one of the options in that list.
Did you try using the share media task function?
Check this article out from the msdn :
http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207027(v=vs.105).aspx
You can use MediaLibrary and there is already an answer for your question in this link. As said, there is no way to select existing sound media and video files through default choosers. Thank you.
I am trying to develop Windows Phone App, I would like to know that how can I call the default web browser with a specific URL(e.g. http://www.google.com) when I launch the program?
Thanks
When you're launching "the program" as you say (Internet Explorer) you use the following code:
WebBrowserTask browser = new WebBrowserTask();
browser.URL = new Uri("http://www.google.com", UriKind.Absolute);
browser.Show();
The WebBrowser task is inside the Microsoft.Phone.Tasks namespace, the documentaion of which is here: Microsoft.Phone.Tasks.WebBrowserTask
You should also know that the "default" browser is always Internet Explorer, because right now there is no way for users to define an alternative browser as their "default".
Edit:
After reading your question more closely, I can tell there is a little bit of ambiguity. If you want to launch the browser immediately when your app launches, you should know the following:
This kind of application will fail Microsoft's marketplace validation (check the Application Certification Requirements for Windows Phone
Even if it didn't fail the certification, it would be a kind of strange application... not one that is of very much use to your users.
If, however you intend to launch the phone's browser when the user clicks a button, then the above code I posted will work just like you want it to, just make sure to include this line at the top of the code file that it's in:
using Microsoft.Phone.Tasks;
Hope that helps!
I have an application, targeting mango devices, which plays music via a BackgroundAudioAgent. As such it integrates with the universal volume control (UVC).
Is there a way to detect when the application is launched by tapping the artists details in the UVC?
Alternatively, is there a way to set a deep link for the UVC to use?
I want this so that I can take the user to the "Now playing" page, rather than the main page, when the app is launched via the UVC.
Update
This also affects launching the app from the now playing tile in the Music & Video hub as the BackgroundAudioPlayer automatically integrates with this part of the hub.
Using MediaHistory Zune Hub integration solves this problem. It also passes the Marketplace Test Kit capability test step in the RC SDK, so that’s a good sign.
If you start from the example on MSDN, calling the following code from GetNextTrack() and GetPreviousTrack() in the background audio agent means that when you click UVC or Zune Now Playing you can get back the navigation query string you specify here…
private AudioTrack ChangeTrack()
{
AudioTrack track = _playList[currentTrackNumber];
IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication();
Stream s = isoStore.OpenFile("ApplicationIcon.png", FileMode.Open);
MediaHistoryItem nowPlaying = new MediaHistoryItem();
nowPlaying.Title = "Background Audio is playing!";
nowPlaying.ImageStream = s;
nowPlaying.PlayerContext.Add("keyString", track.Title);
MediaHistory.Instance.NowPlaying = nowPlaying;
return track;
}
I need to launch my WP7 application from the phone's browser and pass some arguments. For example, the following url would be a link on an html page. Clicking the link would start my application. iPhone and Android both have these capabilites by the name of 'url schemes'.
appName://my.arguments.here
How can I accomplish this on WP7?
Thanks!
Unfortunately there is currently no support for "url schemes" or custom URL handlers that will allow you to handle these requests from within your application.
It is possible to integrate with the search application, which can provide deep linking into your application. It also appears that YouTube has some kind of way of doing it, as the mobile version of their site will jump to the app for playback of videos.
You should use the protocol activation feature of Windows Store apps - see http://msdn.microsoft.com/en-us/library/windows/apps/hh452686.aspx