protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); WowzaGoCoder.Init(this, "GOSK-5E45-010F-E3CB-EF7E-3513"); SetContentView(Resource.Layout.Main); var playerView = FindViewById <WOWZPlayerView>(Resource.Id.stream_player); var playButton = FindViewById <Button>(Resource.Id.playButton); playButton.Click += (sender, args) => { var playerConfig = new WOWZPlayerConfig { HostAddress = "edge.cdn.wowza.com", PortNumber = 1935, ApplicationName = "live", StreamName = "0P0p2VThFWktwdzZFL0N4OXB0ZDl581b", AudioEnabled = true, VideoEnabled = false }; var error = playerConfig.ValidateForPlayback(); if (error != null) { throw new Exception("Config error: " + error.ErrorDescription); } var wowzaCallback = new WowzaCallback(); playerView.Play(playerConfig, wowzaCallback); }; }
public static void Initialize(string key) { var goCoderLicensingError = WowzaGoCoder.RegisterLicenseKey(key); if (goCoderLicensingError != null) { // Log license key registration failure Console.WriteLine(goCoderLicensingError.LocalizedDescription); throw new WowzaClientLicensingKeyException(goCoderLicensingError.LocalizedDescription); } Player = new WOWZPlayer(); }
public void Setup(IWowzaConfig config) { if (config == null) { throw new ArgumentNullException(); } Config = new WowzaConfig(); // Perform any additional setup after loading the view, typically from a nib. Config.AudioEnabled = true; //Config.VideoEnabled = true; Config.HostAddress = config.HostAddress; Config.PortNumber = (nuint)config.PortNumber; Config.ApplicationName = config.ApplicationName; Config.StreamName = config.StreamName; Config.Username = config.Username; Config.Password = config.Password; WowzaGoCoder.SetLogLevel(WowzaGoCoderLogLevel.Verbose); Console.WriteLine(string.Format("{0} {1} {2} {3}", WOWZVersionInfo.MajorVersion, WOWZVersionInfo.MinorVersion, WOWZVersionInfo.Revision, WOWZVersionInfo.BuildNumber)); }