public void play2(IClient client, RequestFunction function,
AMFDataList params) {
}
In the params object you should receive the RTMP request to change streams with some other information. Although the sever may receive a request it does not mean it will be actioned and a callback is made to the client if successful.
If play2 is not being called then no switching is taking place. The streams do need to be active for switch to occur so if they are not available on the edge the player will not switch.
ngrp do not get forwarded to the edge. With this HHTPProvider, you can create a SMIL from using the medialist tool on the origin and create a file that you host in the content folder on the edge:
I found a interface IMediaStreamNameAliasProvider2 which looks promising for my use case. It has a bunch of resolvePlayAlias methods. However couple of queries
does these method gets called every time a client tries to switch from one rendition to another.
is there a better/alternate way to do this since in these methods i will have to parse stream names to check which bitrate is requested . ie (streamName = myStream_360p will mean player asked for 360p rendition).
correct me if i am wrong …onHTTPCupertinoStreamerRequest this method as name suggest will apply only for hls playback. What about the rtmp playback. How to track when a particular player switches from one bitrate to another in dynamic rtmp playback.
Thanks. using onHTTPCupertinoStreamerRequest() and play2() i am able to track when clients switches between various bitrates.
Also i am trying to track when a player disconnects the session. I found IClientNotify has a method onClientDisconnect(IClient client) which i can use.
But i am not able to get stream name from client object. there are some methods in client class ( like getUri) which give me url of stream but that url does not contain the stream Name.
an Update - when i was testing with a flash player (StrobeMediaPlayer) play2() method was being called whenever switching was taking place . But when i am trying to use Jwplayer to play the streams play2() is not getting called.
i am using a amlst module to serve the smil file to jwplayer.
So how to fix this . is there a way from server side module through which i can do the job of FCSubscribe ie to hold all rendition of streams on edge app . i dont think i will have access to jwplayers source code so doing something on server side appears to be my only option.
i already have a custom IMediaListProvider in a Edge app module which generates smil file for jwplayer.
if i hit this url (http://localhost:1935/edge/amlst:myStream/jwplayer.smil ) in browser i get a valid smil file . But problem i am facing is i want to make sure that all consumers of streams to connect on edge servers. For achieving that i will have to make sure all renditions of stream be available to edge application.
One way to achieve this is to call Netstream.FCSubscribe() from video player for each rendition. Since i cannot update code of jwplayer , Is there a way to achieve the same from server side ie to copy renditions of stream on edge app on all edge servers ?