Schedule Wowza媒体服务器2.2.3时间表
是否可以使用此版本的Wowza安排播放列表 我尝试上传模块集合的文章,但没有成功,在日志上没有记录任何关于播放列表的数据Schedule Wowza媒体服务器2.2.3时间表,schedule,playlist,wowza,Schedule,Playlist,Wowza,是否可以使用此版本的Wowza安排播放列表 我尝试上传模块集合的文章,但没有成功,在日志上没有记录任何关于播放列表的数据 /conf/live/Application.xml <Module> <Name>streamPublisher</Name> <Description>Playlists</Description> <Class>com.wowza.wms.plugin.collection.module.Modul
/conf/live/Application.xml
<Module>
<Name>streamPublisher</Name>
<Description>Playlists</Description>
<Class>com.wowza.wms.plugin.collection.module.ModuleStreamPublisher</Class>
</Module>
<Property>
<Name>streamPublisherSmilFile</Name>
<Value>playlists.smil</Value>
<Type>String</Type>
</Property>
/conf/live/Application.xml
streamPublisher
播放列表
com.wowza.wms.plugin.collection.module.ModuleStreamPublisher
streamPublisherSmilFile
playlists.smil
一串
我在Wowza 2.2.3版实例上测试了这个模块,它对我来说运行良好,访问日志显示如下:
ServerListenerStreamPublisher Scheduled: Stream1 for: 2015-04-07
ServerListenerStreamPublisher stream is **NOT** set to not repeat, setUnpublishOnEnd: true Stream1
ServerListenerStreamPublisher scheduled playlist: Stream1 on stream: Stream1 for:Tue Apr 07
ServerListenerStreamPublisher Scheduled stream is now live: Stream1
ModuleStreamPublisher.onAppStart: [live/_definst_]: DONE!
Stream.switch[live/_definst_/Stream1]: index: 0 name:mp4:sample.mp4 start:5 length:5
此模块可以在服务器级别或应用程序级别完成。不同之处在于启动输出流,在服务器级别上实现会自动连接计划的播放列表,而在应用程序级别上,则需要手动连接包含计划的SMIL文件
要在应用程序级别进行连接,请执行以下操作:
<smil>
<head></head>
<body>
<stream name="Stream1"></stream>
<playlist name="pl1" playOnStream="Stream1" repeat="true" scheduled="2015-04-07 16:00:00">
<video src="mp4:sample.mp4" start="5" length="5"/>
<video src="mp4:elephantsdream_750.mp4" start="50" length="25"/>
<video src="mp4:sample.mp4" start="0" length="150"/>
</playlist>
</body>
</smil>
package com.wowza.wms.example.serverlistener;
import com.wowza.wms.logging.WMSLoggerFactory;
import com.wowza.wms.server.*;
import com.wowza.wms.vhost.*;
import com.wowza.wms.stream.publish.*;
import com.wowza.wms.application.*;
public class StreamPublisherDemo implements IServerNotify2 {
public void onServerConfigLoaded(IServer server)
{
}
public void onServerCreate(IServer server)
{
}
public void onServerInit(IServer server)
{
IVHost vhost = VHostSingleton.getInstance(VHost.VHOST_DEFAULT);
IApplication app = vhost.getApplication("live");
IApplicationInstance appInstance = app.getAppInstance("_definst_");
Stream stream1 = Stream.createInstance(vhost, "live", "Stream1");
stream1.play("mp4:sample.mp4", 5, 5, true);
stream1.play("mp4:sample.mp4", 50, 5, false);
stream1.play("mp4:sample.mp4", 150, 5, false);
stream1.addListener(new StreamListener(appInstance));
Stream stream2 = Stream.createInstance(vhost, "live", "Stream2");
stream2.play("mp4:sample.mp4", 0, -1, true);
stream2.addListener(new StreamListener(appInstance));
}
public void onServerShutdownStart(IServer server)
{
}
public void onServerShutdownComplete(IServer server)
{
}
class StreamListener implements IStreamActionNotify
{
StreamListener(IApplicationInstance appInstance)
{
}
public void onPlaylistItemStop(Stream stream, PlaylistItem item)
{
WMSLoggerFactory.getLogger(null).info("Item Stopped: " + item.getName() + "on Stream: " + stream.getName());
}
public void onPlaylistItemStart(Stream stream, PlaylistItem item)
{
WMSLoggerFactory.getLogger(null).info("Item Started: " + item.getName() + "on Stream: " + stream.getName());
}
}
}