• SEARCH
  • DOWNLOADS
  • MY ACCOUNT
  • Buy (0)
  • CONTACT
  • Free Trial
Wowza Logo
  • PRODUCTS
    • Products

      • Wowza ClearCaster
      • Facebook Live appliance
      • Wowza Streaming Cloud
      • Cloud streaming services
      • Wowza Streaming Engine
      • Streaming server software
      • Wowza GoCoder & SDK
      • Mobile capture and encoding app
    • Capabilities

      • CDN
      • Ultra Low Latency
      • SRT
      • Player
      • WebRTC
      • Live Transcoding
      • See All Capabilities
  • DOCS & APIS

      Docs & APIs

      • Getting Started
      • User Guides
      • Technical Articles
      • Video Tutorials
      • API & SDK Docs
  • SOLUTIONS
    • Streaming Types

      • Live Video Streaming
      • Video on Demand
      • Audio-Only Streaming
      • IP Camera Streaming
      • VR and 360° Streaming
      • Chat
    • Industries

      • Broadcast & OTT
      • Education
      • Enterprise
      • Government
      • Live Events
      • Live Sports
      • Religious Organizations
    • Streaming Solutions

      • MediaDS—Integrated Streaming Device
      • Streaming Service Providers
      • Live Mobile Broadcasting
  • PRICING
    • Wowza ClearCaster

      • Facebook Live appliance
      • Starting at $2,995
      • Add to Cart
      • Request a Demo
    • Wowza Streaming Cloud

      • Cloud streaming services
      • Starter Plan: $49/month
      • Add to Cart
      • See All Plans
    • Wowza Streaming Engine

      • Streaming server software
      • Annual Plan: $65/month
      • Add to Cart
      • See All Plans
    • Wowza GoCoder SDK

      • SDK for mobile streaming
      • Talk to a Streaming Expert
      • Contact Us
      • Free Trial
  • RESOURCES

      Resources

      • Blog
      • Case Studies
      • Webinars
      • Videos
      • Podcasts
      • Test Players
      • Developer Tools
  • SUPPORT
    • Support

      • Forums
      • Software Updates
      • Open a Support Ticket
    • Plans & Services

      • Support Plans
      • Advisory Services
      • Live Event Support
  • My Account
  • Buy (0)
  • SEARCH
  • Ask a question
  • Forums
    • Wowza ClearCaster
    • Wowza Streaming Engine
    • Wowza Streaming Cloud
    • Wowza Player
    • Wowza GoCoder SDK
    • Wowza Developer Dojo
    • Topics
    • Questions
    • Users
    • Badges
  • Sign in
  • Community Home /
  • Wowza Streaming Engine /
  • Performance and Tuning /
avatar image
Question by John Terrorhawk · Aug 01, 2009 at 08:09 AM · performance and tuning

Livestream plugin and jwplayer

I'm trying to get the livestream plugin from jwplayer to work with my wowza stream.

my stream has a security token and it looks like the plugin doesnt handle that.

INFO server comment - SecureURLParams.onAppStart: hodtv_live/_definst_
INFO application app-start _definst_ hodtv_live/_definst_
INFO session connect-pending xxx.xxx.xxx.xxx -
INFO session connect xxx.xxx.xxx.xxx -
INFO stream create - -
INFO server comment - SecureURLParams: play: rejected


my livestream code is :

livestream.streamer=rtmp://myurl/hodtv_live/_definst_/doConnect=connecttoken&livestream.file=live.sdp


this is my application

<Property> 
  <Name>secureTokenSharedSecret</Name> 
  <Value>verysecret</Value> 
 </Property> 
<Property> 
  <Name>secureurlparams.connect</Name> 
  <Value>connecttoken.doConnect</Value> 
 </Property>
 <Property> 
  <Name>secureurlparams.publish</Name> 
  <Value>Tokenpub.doPublish</Value> 
 </Property>


the stream works perfect with just jw-player and token build in the source code.

here is the source for livestream plugin:

package com.jeroenwijering.plugins {
import com.jeroenwijering.events.*;
import com.jeroenwijering.utils.Logger;
import flash.display.*;
import flash.events.*;
import flash.net.*;
import flash.utils.setTimeout;
import flash.text.*;
/**
* This plugin automatically polls an RTMP stream for availability every XX seconds.
* If the stream is available, it will kick in.
* It allows users to wait for a live event without having to refresh their page.
**/
public class Livestream extends MovieClip implements PluginInterface {
	[Embed(source="../../../animation.swf")]
	private const Animation:Class;
	/** Background image. **/
	private var back:Sprite;
	/** List with configuration settings. **/
	public var config:Object = {
		file:undefined,
		image:undefined,
		interval:15,
		message:'Checking for livestream...',
		streamer:undefined,
		tags:undefined
	};
	/** Netconnection instance to check availability. **/
	private var connection:NetConnection;
	/** The number times the plugin tried to connect. **/
	private var count:Number = 0;
	/** The textfield showing all messages. **/
	private var field:TextField;
	/** Netstream instance to check availability. **/
	private var stream:NetStream;
	/** Reference to the view. **/
	private var view:AbstractView;
	/** Constructor. **/
	public function Livestream():void {
		connection = new NetConnection();
		buildStage();
	};
	/** Build all stage graphics. **/
	private function buildStage():void {
		back = new Sprite();
		back.graphics.beginFill(0x000000,0.6);
		back.graphics.drawRect(0,0,300,70);
		addChild(back);
		var anm:DisplayObject = new Animation();
		anm.x = 134;
		anm.y = 10;
		addChild(anm);
		field = new TextField();
		field.defaultTextFormat = new TextFormat('_sans',13,0xFFFFFF,null,null,null,null,null,TextFormatAlign.CENTER);
		field.width = 300;
		field.height = 20;
		field.y = 45;
		addChild(field);
		mouseEnabled = false;
		visible = false;
	};
	/** Try connecting to the livestream. **/
	private function checkStream():void {
		count++;
		connection.addEventListener(NetStatusEvent.NET_STATUS,statusHandler);
		connection.connect(config['streamer']);
		visible = true;
		setTimeout(hide,2000);
		Logger.log('checking for stream; attempt: '+count,'livestream');
	};
	/** Hide the icon again after a check. **/
	private function hide():void {
		visible = false;
	};
	/**
	* Start the plugin.
	*
	* @param vie	A reference to the View of the player; the API entrypoint.
	**/
	public function initializePlugin(vie:AbstractView):void {
		view = vie;
		if(!config['tags'] || config['tags'] == view.config['tags']) {
			view.config['icons'] = false;
			view.config['repeat'] = 'always';
			setTimeout(checkStream,2000);
			view.addControllerListener(ControllerEvent.RESIZE,resizeHandler);
			field.text = config['message'];
		}
	};
	/** The livestream is found. Now switch to it. **/
	private function loadStream():void {
		view.config['autostart'] = true;
		view.config['icons'] = true;
		view.config['repeat'] = 'none';
		var obj:Object = {
			duration:0,
			file:config['file'],
			image:config['image'],
			streamer:config['streamer'],
			type:'rtmp'
		}
		view.sendEvent('LOAD',obj);
	};
	/** Reposition the icon on resize. **/
	private function resizeHandler(evt:ControllerEvent):void {
		x = config['x'] + config['width']/2 - 150;
		y = config['y'] + config['height']/2 - 35;
	};
	/** Receive NetStream status updates. **/
	private function statusHandler(evt:NetStatusEvent):void {
		switch(evt.info.code) {
			case 'NetConnection.Connect.Success':
				stream = new NetStream(connection);
				stream.client = new Object();
				stream.addEventListener(NetStatusEvent.NET_STATUS,statusHandler);
				stream.play(config['file']);
				Logger.log('connected to server '+config['streamer'],'livestream');
				break;
			case 'NetStream.Play.Start':
				stream.removeEventListener(NetStatusEvent.NET_STATUS,statusHandler);
				connection.removeEventListener(NetStatusEvent.NET_STATUS,statusHandler);
				stream.close();
				connection.close();
				setTimeout(loadStream,2000);
				Logger.log('found stream '+config['file'],'livestream');
				break;
			case 'NetStream.Play.StreamNotFound':
			case 'NetConnection.Connect.Failed':
				stream.removeEventListener(NetStatusEvent.NET_STATUS,statusHandler);
				connection.removeEventListener(NetStatusEvent.NET_STATUS,statusHandler);
				setTimeout(checkStream,config['interval']*1000);
				Logger.log('no livestream yet: '+evt.info.code,'livestream');
				break;
		}
	};
};
}


Does anyone know how to fix this problem? couse i think this plugin is very usefull for livestreamers

Grz

Terrorhawk
Comment

People who like this

0 Show 0
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

5 Replies

· Add your reply
  • Sort: 
avatar image

Answer by Richard Lanham · Aug 01, 2009 at 01:12 PM

Make sure you are only using the SecureURLParams module, which includes the functionality of SecureToken. If you have both, that could be a problem. See note at bottom of package readme.html

From what I can see it looks right.

I would try it with plain JW Player without plugin, see if that works first.

Richard
Comment

People who like this

0 Show 1 · Share
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image John Terrorhawk · Aug 01, 2009 at 03:07 PM 0
Share
without thw plugin it works perfect.

only when i activate the plugin i get that error message.. so my gues is that it has something to do with the token

 <Name>secureTokenSharedSecret</Name> 
  <Value>verysecret</Value> 
 </Property> 


in jw palyer itself i enterd the verysecret as token in the source code. but i think i need to do that with the livestream plugin as well. as it also tryes to connect.

But i'm realy not good with flash and its actionscript
avatar image

Answer by Richard Lanham · Aug 01, 2009 at 02:15 PM

I'm wonder if this plug-in is actually useful with Wowza. All it does is poll for a live stream if it does not exist when play starts, and will play it when it publishes. But I think JW player will do that without the polling mechanism (?)

Richard
Comment

People who like this

0 Show 1 · Share
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image John Terrorhawk · Aug 01, 2009 at 03:45 PM 0
Share
well i'm using 2 stream..

1 live stream and one stream that is localy streamed to wowza with vlc ffor not live events..

So jwplayer sould play not_live but if some dj starts stream at live it sould make the switch to that stream.. and when live is gone it sould go back to not_live

And as far as i know this plugin sould do the job
avatar image

Answer by Richard Lanham · Aug 01, 2009 at 02:47 PM

Okay, that makes sense. Nice feature if it works.

I think you are right, you will have to put the secureToken in the plugin, because the connection is established and handled in the plugin.

Richard
Comment

People who like this

0 Show 1 · Share
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image John Terrorhawk · Aug 01, 2009 at 04:16 PM 0
Share
yes i notice that.. but do u know how to implent that token to the plugin?

if we can fix that then this is a great plugin for me and i think other users as well.

i realy only know some basic things in as3 but that token for connection is going to far for me..
avatar image

Answer by Richard Lanham · Aug 17, 2009 at 12:17 PM

Try it like this:

/** Receive NetStream status updates. **/

private function statusHandler(evt:NetStatusEvent):void {

switch(evt.info.code) {

case 'NetConnection.Connect.Success':

// ADD THESE LINES:

if (evt.info.secureToken != undefined) //<--- SecureToken change here - respond with decoded secureToken

{

netconnection.call("secureTokenResponse", null, TEA.decrypt(evt.info.secureToken,"#ed%h0#w@1"));

}

stream = new NetStream(connection);

stream.client = new Object();

stream.addEventListener(NetStatusEvent.NET_STATUS,statusHandler);

stream.play(config['file']);

Logger.log('connected to server '+config['streamer'],'livestream');

break;

case 'NetStream.Play.Start':

stream.removeEventListener(NetStatusEvent.NET_STATUS,statusHandler);

connection.removeEventListener(NetStatusEvent.NET_STATUS,statusHandler);

stream.close();

connection.close();

setTimeout(loadStream,2000);

Logger.log('found stream '+config['file'],'livestream');

break;

case 'NetStream.Play.StreamNotFound':

case 'NetConnection.Connect.Failed':

stream.removeEventListener(NetStatusEvent.NET_STATUS,statusHandler);

connection.removeEventListener(NetStatusEvent.NET_STATUS,statusHandler);

setTimeout(checkStream,config['interval']*1000);

Logger.log('no livestream yet: '+evt.info.code,'livestream');

break;

}

};


Richard
Comment

People who like this

0 Show 1 · Share
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Richard Lanham · Aug 17, 2009 at 12:27 PM 0
Share
Also noticing that you are using secureURLParams (doConnect). You don't need it and it will be a problem to include the ampersand "&" in stream Flashvar

Just use SecureToken.

Richard
avatar image

Answer by Josh Chesarek · Aug 02, 2009 at 12:31 PM

I just re-read this question about live and will have to play with it a little. Sorry about that.
Comment

People who like this

0 Show 1 · Share
10 |600 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image John Terrorhawk · Aug 17, 2009 at 11:39 AM 0
Share
nobody know how to add the serurity token to this plugin?

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

where did flush interval goes ? 1 Answer

Problem with local and external IP 1 Answer

HLS Playback Start Time: RTSP vs MPEG-TS source stream 1 Answer

Wowza Streaming with Teradek Cube 255 and JW/bit dash player 1 Answer

Using the FLVPlayback component with Wowza Pro 5 Answers

Hot Topics
  • AWS Hosting
  • Mobile SDK
  • Deployment Options
  • Load Balancing
  • Content Security
Product Sign-in
  • Wowza Streaming Cloud
  • Wowza Player
Under the Hood
  • Developer Tools
  • Wowza System Status
  • Test Players
  • Developer IDE
Resellers
  • Find a Reseller
  • Reseller Portal
  • Become a Reseller
Company
  • About Us
  • Blog
  • News
  • Events
  • Careers
  • Customers
  • Partners
  • Contact Us
Stay Connected
Get Monthly Newsletter
Select a Language
  • English
    • English
    • Español
    • 日本語
    • 한국어
    • हिन्दी भाषा
    • 中文
    • русский язык

© 2005–2018 Wowza Media Systems, LLC. All rights reserved.   Terms | Privacy | Trademarks | Legal


Enterprise
Social Q&A

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Create an article
  • Forums
  • Wowza ClearCaster
  • Wowza Streaming Engine
  • Wowza Streaming Cloud
  • Wowza Player
  • Wowza GoCoder SDK
  • Wowza Developer Dojo
  • Explore
  • Topics
  • Questions
  • Users
  • Badges