-
Hello!
What would be the best way to utilize a global variable w/ FV Player?I have created global variable called $token
It works and is available on my page, as I’ve been able to get it to print out the variable value on my page.
How can I get that to be used at the end of a URL?
If I add it in the FV Player database:
https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4?token=$tokenIt doesn’t work. You can see on the Streaming Server coming in as:
https://file-examples-com.github.io/uploads/2017/04/file_example_MP4_480_1_5MG.mp4?token=Same goes if you try using the URL in the shortcode:
[fvplayer src=https://mystreamingserver.com:443/live/whiteroom/playlist.m3u8?token=$token live='false']I see this on my streaming server.
INFO server comment – Client connecting with id 590366983 and query string token=$token
So the global variable doesn’t get called.
Do you have a way to call a global variable directly in WordPress editor or in your shortcode editor?
I have tried a 3rd party plugin, Woody Ad Snippets https://woodysnippet.com/
and that does actually launch the FV Player with my global variable $token value added to the end of url .
https://mystreamingserver.com:443/live/whiteroom/playlist.m3u8?token=5f66cc2b0fb30But I get some funky behavior from FV Player when launched this way.
Here is what I get. First off, I am trying to play a Live feed from a Streaming Server (HLS).
Here are my issues:
A)
If I use the shortcode config live=”true”, then when I click play, the the video plays and I can hear the audio, but the “buffer” icon keeps going, even though the video and audio is playing fine. If you hit the “rewind” video button, then it goes away.B) As a work around to the above, ,I switch it to live=”false, then when I click play, the the video plays and I can hear the audio, but the video progress bar scroll across the screen from left to right as progress bars go, but keeps going BEYOND the player itself, until it hits the very right side of the browser.
If I put a regular FV Player via shortcode (but not launched through the snippets plugin) then they do not exhibit either of these issues.
It’s not a buffering issues as it ONLY happens when launching the FV Player via shortcode inside of another plugin.
But that is the ONLY way that I’ve been able to get access to my global variable that I have set.
Here’s the code that I”m using in Woody Snippets that IS launching FV Player with my global variable $token populated with the value.
global $token;
echo “<p>”;
echo do_shortcode(“[fvplayer src=https://mystreamingserver.com:443/live/whiteroom/playlist.m3u8?token={$token} live='false']“);Need some help, if you have any ideas to try?
Thanks!