Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Presentation Module HTTPproviders

  1. #1

    Default Presentation Module HTTPproviders

    Im just starting of creating the presentation thing. (Wowza 2)

    But I get get it to work. I created the file with wowza IDE as stated in this tutorial: http://www.wowza.com/forums/content....L-Presentation

    I have uploaded the jar file to the lib directory. But not sure what name the file should have?

    In the server log it gives me an ClassnotFoundExeption. So I think it can't find the file ?

    <HTTPProvider>
    						<BaseClass>com.wowza.wms.example.module.http.HTTPresentation</BaseClass>
    						<RequestFilters>*presentation</RequestFilters>
    						<AuthenticationMethod>none</AuthenticationMethod>
    					</HTTPProvider>
    file: lib/wms-example-module.jar

    Would love to get a hint

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Did you restart Wowza after adding the .jar file? That is required

    Richard

  3. #3

    Default

    Yes I did. Tried renaming the file several times. But this should be correct filename right?

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    The name of the .jar file doesn't matter if it contains the Class you are referencing (it can have many Classes). And it shouldn't matter if you change the name, unless you changed it after re-starting Wowza. The .jar file is placed in the Wowza /lib folder, is that where you put it?

    Richard

  5. #5
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Actually, I don't think changing the name of the .jar file would matter either, as it is already loaded into memory.

    Richard

  6. #6

    Default

    Quote Originally Posted by rrlanham View Post
    Actually, I don't think changing the name of the .jar file would matter either, as it is already loaded into memory.

    Richard
    Hmmz should be something else then.

    This is the file:
    package com.wowza.wms.example.module.http;
    
    import java.io.*;
    import com.wowza.wms.http.*;
    import com.wowza.wms.vhost.*;
    import java.util.List;
    import java.util.Map;
    
    public class HTTPresentation extends HTTProvider2Base {
    	
    	public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {
    		
    		if (!doHTTPAuthentication(vhost, req, resp))
    			return;
    		
    		req.parseBodyForParams(true);
    			
    		Map<String, List<String>> params = req.getParameterMap();
    			
    		if (req.getQueryString()=="")
    		{
    			new FileResponder(resp, "/assets/wowza.html");
    		}
    		if (params.containsKey("file")) {
    			new FileResponder(resp, "/assets/" + params.get("file").get(0));
    		}
    	}
    	class FileResponder
    	{
    		FileResponder(IHTTPResponse resp, String loc)
    		{
    			try
    			{
    		       InputStream is = this.getClass().getResourceAsStream(loc);
    		       BufferedInputStream inf = new BufferedInputStream(is);
    		       OutputStream out = resp.getOutputStream();
    
    		       byte[] bytes = new byte[4096];
    		       while(true)
    		       {
    	               int byteRead = inf.read(bytes);
    	               if (byteRead < 0)
    	                       break;
    	               out.write(bytes, 0, byteRead);
    		       }
    			}
    			catch (Exception e)
    			{
    			}
    		}
    	}
    }
    and log:


    ERROR server comment - loadHTTPProvider: error parsing HTTPProvider properties: java.lang.ClassNotFoundException: com.wowza.wms.example.module.http.HTTPresentation
    java.lang.ClassNotFoundException: com.wowza.wms.example.module.http.HTTPresentation.

    Anything I'm missing? havent updated wowza in some tho.. is this needed from a specific version?

  7. #7
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    What version of Wowza are you using?

    Richard

  8. #8

    Default

    version: 2.2.3.11

  9. #9
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    I don't think HTTProvider2Base is support in Wowza 2, it is new to Wowza 3. Upgrade for you is free:

    http://www.wowza.com/forums/content....-Upgrade-Guide

    Richard

  10. #10

    Default

    Thanks, Will give it an upgrade soon!

Page 1 of 2 12 LastLast

Similar Threads

  1. Presentation using Wowza
    By armanmisdar in forum General Forum
    Replies: 3
    Last Post: 09-26-2014, 03:07 AM
  2. Video Consultation and e-Presentation - Web Application
    By VideoWhisper.com in forum Showcase
    Replies: 0
    Last Post: 10-22-2012, 08:08 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •