Embedding iframe player, audio-only mode available?

Hello

version: 5.2.944

I am using WebCallServer 5 (hosted on AWS) and want to embed the player via an iframe.
As i sometimes have an audio-only stream, i would like to only show the controls and no video player.
How is that possible (i was looking for a flag like "audio-only" to pass to the player


Best,
Thomas
 

Max

Administrator
Staff member
Good day
As i sometimes have an audio-only stream, i would like to only show the controls and no video player.
How is that possible (i was looking for a flag like "audio-only" to pass to the player
Unfortunately, Embed player does not support such function. Use Player example instead, in this case you can modify source code to display controls as needed.
 

Max

Administrator
Staff member
Please try to use Embed Player attached. You should replace /usr/local/FlashphonerWebCallServer/client2/examples/demo/streaming/embed_player by attached archive content (actually, only player.js file is changed). This modification supports audioOnly parameter, for example
Code:
https://wcs:8888/embed_player?urlServer=wss://wcs:8443&streamName=test&mediaProviders=WebRTC&audioOnly=true
This should not display video even if video track is present in stream playing. Also, fullscreen control is removed in this case, only play/pause and volume controls are displaying.
 

Attachments

Wow thanks a lot, i will try soon :)
Is there a possibility to bring the fullscreen button back but only, if the parameter 'audioOnly=true' is not set and allowfullscreen='allowfullscreen' is set? This would be ideal since then, when using audio/video mode the user can use fullscreen and in audio only mode, its not available (makes no sense here)
 

Max

Administrator
Staff member
This would be ideal since then, when using audio/video mode the user can use fullscreen and in audio only mode, its not available (makes no sense here)
Fullscreen button will hide only if audioOnly=true is set, otherwise it should be displayed.
 
Its not working for me :(
I just replaced the player.js and restarted the Flashphoner service.
But right now, (with the parameter set or removed), the video placeholder is still shown and the player isn't able to play anything (there is an endless spinner if i try to start playing)
 
Last edited:

Max

Administrator
Staff member
But right now, (with the parameter set or removed), the video placeholder is still shown and the player isn't able to play anything (there is an endless spinner if i try to start playing)
Please update Web SDK to the latest build 2.0.198.
If this does not help, please provide SSH access to the server and to the publishing/playing pages using this form.
 
Last edited:

Max

Administrator
Staff member
We responded you in this topic.
It is not necessary to update the whole instance. Please note that you must configure WCS instance from the scratch when updating to a new image.
You can update WebSDK only:
1. Download and unpack WebSDK installation package
Code:
wget https://flashphoner.com/downloads/builds/flashphoner_client/wcs_api-2.0/flashphoner-api-2.0.198-d42a4890646d96ad567ab2c49278a4b4a5956227.tar.gz -O- | tar -zx
2. Copy WebSDK over the current version
Code:
cd @flashphoner/websdk-2.0.198/
sudo cp -r * /usr/local/FlashphonerWebCallServer/client2/
cd ..
sudo cp client.version /usr/local/FlashphonerWebCallServer/client2/
You should replace player.js after update.
 
Ok i learned it the hard way.

After an update of the whole instance to the latest version and replacing the player.js it still not works.
The iframe still shows the video part (which is blank if i only stream audio). I use
<iframe id="fp_embed_player" src="https://...:8888/embed_player?urlServer=wss://...:8443&amp;streamName=test&amp;mediaProviders=WebRTC&amp;audioOnly=true" marginwidth="0" marginheight="0" scrolling="no" allowfullscreen="allowfullscreen" width="100%" height="100%" frameborder="0">
 

Max

Administrator
Staff member
We made a test: published video+audio stream to the server from which Embed Player should play, and played from the page you've provided. Seems like Embed Player is working: audio only is playing, and only start/stop and volume controls are shown:
1632733943467.png

You can change iframe size if this seems too big, for example (300x150):
1632734511051.png

Anyway, player will use video HTML5 element to play a stream.
 
Hi

Ah i see. What i meant and needed is that the video element is not shown in case of audio only. Thiss means, only a small black rectangular frame for the play button and volume selector. It doesn't make any sense to have an empty video placeholder in that case and the player should be as small as possible
 
Last edited:

Max

Administrator
Staff member
Ah i see. What i meant and needed is that the video element is not shown in case of audio only. Thiss means, only a small black rectangular frame for the play button and volume selector. It doesn't make any sense to have an empty video placeholder in that case and the player should be as small as possible
Please try player.js from archive attached.
The player width and height can be set by iframe attributes, for example
Code:
<iframe ... width=480 height=50>
1632793090207.png
 

Attachments

Well now its not working correctly, it works in audio only mode (is set height to 50. But when i enable the audio/video mode the placeholder is super small.

What i need is
-the iframe is set to the normal width and height for audio/video mode (so i think of it as maximum width and height)
-In this mode, the player works like normal (display video and play audio, have all controls available)
-If audio only is enabled, the video player (id "remoteVideo") is hidden meaning that the whole player shrinks (i don't know how to do that). Only the play and volume buttons are seen
 
Last edited:

Max

Administrator
Staff member
If audio only is enabled, the video player (id "remoteVideo") is hidden meaning that the whole player shrinks (i don't know how to do that).
remoteVideo item cannot be hidden because video item to play a stream is added as child to it
If you know on client side what to play (audio-only or video+audio), set iframe size dynamically as needed:
- for video+audio, set
Code:
<iframe ... width=480 height=270>
- for audio only, set
Code:
<iframe ... width=200 height=50>
 
Top