i just implemented the PLAY_VIDEO menu item linked to a youtube video and it works.
The only enhancement i want to make to the flow is to remove one tap in order to stream the video.
Now the flow is the following:
1) User taps to prompt the menu for the card. The PLAY menu item appears.
2) The user taps on PLAY, the video start to load
3) The user needs to tap again to start the video.
Is there a way to stream the video right after the tap from point 2?
Kind regards
There is currently no way to setup a menu hierarchy, which I think is what you're getting at.
Plus, having that extra tap would be an inconsistent experience with the way playback behaves on Glass in the native app and other apps being created.
Why do you want to do the extra tap?
Related
My use case: I have an image that is the preview of a video. When the user tap the preview, the video should starts a fullscreen playback (I suppose in another Form). When the video ends or when the user tap the video during the playback, the previous Form should be shown. This is the same use case of the question: Codename One landscape oriented Form in a portrait locked app
My question: the MediaPlayer class doesn't seem to expose a method to perform a custom action when pressing the video or when the video ends, like requested by this use case. The MediaPlayer is a peer component, so I'm not sure if trying to use a button as a leader component can make sense to do an action after a tap. Any idea?
Unfortunately media is pretty complicated in that sense. You can either rely on the behavior of the media player natively which handles orientation change, playback etc. seamlessly (seek etc.). Or you can implement everything on your own in a media object in which case you can use native peer overlay and have a transparent component on top of the media view which will grab all the clicks.
The former will provide a more native UX and will auto-rotate the UI but we don't have control since there's no Form underlying the UI. It's shown when you invoke setNativePlayerMode(true). When you tap the video in this case it pauses. To exit playback you would use device native keys e.g. back or a done button and would be returned to the parent Form. Notice that since this is native behavior it acts differently on the device and it's important to do device testing here.
Your alternative is to place a media component in the center of the screen and then you can override everything and customize everything. You can place a layered layout on top and grab all tap events. You will need to add your own progress, play, pause etc. UI elements. The user would need to physically rotate the device as orientation won't switch on its own (for the most part).
I'm a begginer in visual basic wpf apps, i just want to click on a button and it play the song.
My task is to put some alarm songs on this app just to give it to my mate and he chooses the best alarm song.
You can use System.Windows.Controls.MediaElement to play music files.
http://vbcity.com/blogs/xtab/archive/2009/06/29/how-to-play-sounds-and-music-in-wpf.aspx
Instagram has a really cool interaction where you can tap-and-hold, aka longPress, on an image and an interactive pop-up appears. Once it appears you can drag your finger to one of the action buttons and removing your finger applies the action and closes the pop-up.
Here it is in action.
And here's a link to a video if you need a closer look.
In my app I've got the tap-and-hold popup working, but the finger drag continues to control the underlying View.
How do you get the finger interaction to transfer to the pop-up?
How do you get the buttons responding to finger drag-over?
This is something you can achieve with PanResponder. Using Pan Responder you are basically creating your own touchable components. Click here for the docs.
Also, you would need the Animated API for animating the transitions.
I'd like to pin a custom tile to the start menu and launch a website or desktop file when I click on it. There's an app called Better start menu, but it has to keep running and not the best experience.
Can I just place some HTML/XML markup at a specific location and it gets displayed?
I am working on wondows mango app and I have two XAML pages(say page1 and page2). On page1 I have a playlist and on page2 I have a media element that plays the song selected on page1, now what I want is to keep song playing in background as user switches between pages. I got a few links that keep song playing when app gets in background but not when a page is closed(by clicking back button).
How can I achieve this, all suggestions, pointers are welcome.
Thanks,
Ravi Gupta - :( newbie at windows phone
You'll want to use the BackgroundAudioPlayer for this. MSDN has a complete sample for playing audio in the background. You can download their sample from here. You can add a project to you application to handle processing background audio (if you need the audio to play after the app closes) or you can handle it all within the application itself my subscribing to the PlayStateChanged event. From the event you can set the next track.
You can also use XNA's MediaPlayer() See: https://stackoverflow.com/a/11385865/1510036