I'm having a problem finding simple examples that handle Alexa audioplayer events using node.js. So far, I've only been able to get the play directive to work using the following:
this.response.audioPlayerPlay('REPLACE_ALL', 'URL', 0);
this.emit(':responseReady');
How do I stop the audio from playing? Any time I try to trigger the StopIntent during playback by saying "stop", it triggers the PauseIntent. I want to be able to stop playback and end the session, pause playback, and resume playback. I've looked at the examples on GitHub and I haven't found them very helpful.
this.response.audioPlayerStop(); //this part will stop the audio player from playing the current stream.
I am struggling to stream hosted audio files like the one below:
http://res.cloudinary.com/karmo/raw/upload/v1415468388/kdzu36kr8t7aowkeqrn7.mp4
I have tried using AVPLayer with the initWithURL and while I do not get any errors I never hear any audio play back.
NSURL *url = [NSURL URLWithString:#"http://res.cloudinary.com/karmo/raw/upload/v1415468388/kdzu36kr8t7aowkeqrn7.mp4"];
player = [[AVPlayer alloc]initWithURL:url];
songPlayer = player;
Any previous StackOverflow examples I have found I have the same issue... no errors but I never hear any audio playback
Streaming mp3 audio with AVPlayer
Audio streaming in ios using AVPlayer
What am I missing...
I am working on a metro app. I have to play youtube video in its embeded player not in that provided by metro app.
I search in net and find that there is iframe, flash and object player .I tried to implement in my app but not succeed.
Is there any to play video or I have to use the default metro player to play?
Have a look at How to play YouTube videos in a Windows8 html/javascript app?
You can add a youtube embed code in a webview element.
XAML design
place a webview element
XAML.cs add this code below the this.InitializeComponent();
string htmContent = " html text here";
webview.NavigateToString(htmContent);
Check out the YouTube class from the MyToolkit. You give it a video ID (the last part of the URL) and it gets a MP4 file from Youtube for you that you can play using the standard MediaElement.
I am creating a Monotouch iPhone app that will display streaming videos. I have been able to get the MPMoviePlayerController working with a local file (NSUrl FromFile), but have not been able to get videos streamed from a media server.
Here is the code I am using to play the video:
string url = #"http://testhost.com/test.mp4";
var nsurl = NSUrl.FromString(url);
mp = new MPMoviePlayerController(nsurl);
mp.SourceType = MPMovieSourceType.Streaming;
//enable AirPlay
//mp.AllowsAirPlay = true;
//Add the MPMoviePlayerController View
this.View.AddSubview(mp.View);
//set the view to be full screen and show animated
mp.SetFullscreen(true, true);
//MPMoviePlayer must be set to PrepareToPlay before playback
mp.PrepareToPlay();
//Play Movie
mp.Play();
Is there something else in implementing the MPMoviePlayerController for video streaming that I am missing? I also read that videos for iOS should be streamed using Apple's HTTP Live Streaming on the media server, is that a requirement? I have never worked with video streaming on an iOS device before so I am not sure if there is something lacking in my code or the media server setup or a combination.
I'm pretty sure you need a streaming server to use a video file from an HTTP url. However it's a requirement for applications (on the AppStore) to do so:
Important iPhone and iPad apps that send large amounts of audio or
video data over cellular networks are required to use HTTP Live
Streaming. See “Requirements for Apps.”
The good news is that your existing code should not have to be changed to handle this (it's server, not client side).
I have a frustrating problem with the latest version of Flurry (Flurry iPhone SDK v2.5). When I start my app, quickly exit, then restart the App, the app briefly loads, flickers a black screen, then stays on the black screen. The black screen stays there until I press the home button, at which point I can restart the app normally. I looked into this further, and it turns out that app state delegates are getting called in the wrong order:
applicationDidBecomeActive //app finishes loading the first time
applicationWillResignActive //app begins to resign
applicationWillEnterForeground //At this point, I have quickly restarted the app, and this is called
applicationDidEnterBackground //When this delegate is called, the screen goes black
applicationDidEnterBackground //This gets called when I hit the home button again, after the screen has been hanging for a while.
So what I think this means is some processes take a bit longer to wrap up once I hit the home button, and if I try to start the app again too quickly there is some very odd behavior. If I wait a few seconds to restart the app, the app behaves normally.
To demonstrate this problem, I created the simplest app I could think of, which I will post here. I built this with XCode 3.2.3, in the 4.0 build directly onto my iphone device (iphone 4). This is important, because I couldn't reproduce this problem on the simulator. You can reproduce this app by creating a new navigation based project named simpleApp, and dropping this code in, with your own Flurry API key of course.
Here is simpleAppAppDelegate.m:
#import "simpleAppAppDelegate.h"
#import "RootViewController.h"
#import "FlurryAPI.h"
#implementation simpleAppAppDelegate
#synthesize window;
#synthesize navigationController;
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[FlurryAPI startSession:#"<your api key here>"];
[window addSubview:navigationController.view];
[window makeKeyAndVisible];
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
printf("applicationWillResignActive\n");
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
printf("applicationDidEnterBackground\n");
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
printf("applicationWillEnterForeground\n");
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
printf("applicationDidBecomeActive\n");
}
- (void)applicationWillTerminate:(UIApplication *)application {
printf("applicationWillTerminate\n");
}
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
}
- (void)dealloc {
[navigationController release];
[window release];
[super dealloc];
}
#end
And here is simpleAppAppDelegate.h:
#import <UIKit/UIKit.h>
#interface simpleAppAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
UINavigationController *navigationController;
}
#property (nonatomic, retain) IBOutlet UIWindow *window;
#property (nonatomic, retain) IBOutlet UINavigationController *navigationController;
#end
So anyway, because so many apps are using Flurry I feel like I must be missing something very basic. What really boggles my mind is that I haven't found anyone at all complaining about this particular problem. Also, this is different from the problem in previous versions where the app would appear to start immediately, go black for a few seconds, then resume normally. That problem was solved by calling [FlurryAPI setSessionReportsOnCloseEnabled:false]; after I set the session, but that doesn't help in this case.
Anyway, has anyone else had this problem? I really hope it's just a stupid error on my part. I'm really excited to use Flurry but something like this would cause my app to get rejected.
I wrote Flurry about this and they got back to me really quickly that they'd look into this. About a week later they wrote back and said they fixed it in v2.6 which is now available. I can't seem to reproduce the problem anymore.
Not to say I'm awesome or anything, but I did kind of single handedly fix this bug.
I take this from flurry. Version 2.7 also has the problem but:
[FlurryAPI setSessionReportsOnCloseEnabled:(BOOL)sendSessionReportsOnClose];
This option is on by default. When enabled, Flurry will attempt to send session data when the app is exited as well as it normally does when the app is started. This will improve the speed at which your application analytics are updated but can prolong the app termination process due to network latency. In some cases, the network latency can cause the app to crash.
I'm not sure whether I should be answering my own question in a comment to the original post or to post an answer, but in any case here is the answer:
Flurry is broken, it's been confirmed by others on this apple dev forum thread (you need an account to login):https://devforums.apple.com/thread/56339?tstart=0
Here's hoping Flurry gets a new version out soon, I'd really like to incorporate their offerings into my app.
We just released a new version of the iPhone Flurry SDK that should resolve this issue. Please download this new SDK and let us know if it resolves the issue you are encountering.
--
Sincerely,
-Sheila
Flurry Support