Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Wrong visualization on Android devices (site in Wordpress)


I am creating a site and I have to include a live video.
Company that created the live video gave me the following code:

<div class="wpb_raw_code wpb_content_element wpb_raw_html">
<div class="wpb_wrapper">
<div style="position: relative; display: block; width: 754px; height: 424px;" id="player"><object class="jwswf" name="player" id="player"bgcolor="#000000"data="http://p.jwpcdn.com/6/12/jwplayer.flash.swf" type="
application/x-shockwave-flash" height="100%" width="100%"><param value="true" name="allowfullscreen"><param value="always"name="allowscriptaccess"><param value="true" name="seamlesstabbing"><param
value="opaque"name="wmode"></object><div id="player"style="display: none;"></div></div>
<script src="http://jwpsrv.com/library/5V3tOP97EeK2SxIxOUCPzg.js"></script>
<script type="text/javascript">
if(navigator.userAgent.match(/android/i) != null){
jwplayer("player").setup({file: "http://178.33.224.197:1935/radiortr99/radiortr99/playlist.m3u8",
type: "mp4",
primary: "html5"
});
} else {
jwplayer("player").setup({
sources: [{
file: "rtmp://178.33.224.197:1935/radiortr99/radiortr99"
},{
file: "http://178.33.224.197:1935/radiortr99/radiortr99/playlist.m3u8"
}],
rtmp: {
bufferlength: 3,
},
'autostart': 'true',


title: 'Rtr99',
width: '754',
height: '424',
aspectratio: '16:9',
autostart: 'true',
repeat: 'true',
fallback: false,
logo: {


position: "top-right",
},
abouttext: "",
aboutlink: "",
}); }
</script>

It works fine on PC and iOS devices (I tested it with a real iPad and iPhone5) but on an Android device (real Galaxy Note 3) the player is displayed larger than the smartphone width.

Where I am wrong?

THANKS TO ALL
paolo

5 Community Answers

Alex

JW Player Support Agent  
0 rated :

Hi, Paolo.

I’m not sure why they told you to include the <object> element as you definitely don’t need that. That may be the object that is making larger than the viewport of the phone. Have you tried removing the <object> element?

Also, you really do not need to use that if…else statement to check if the user is using an Android. If you just use the setup that it’s in your “else” section, then the player will see that it can’t play the RTMP stream and use the HLS stream instead.

Thank you.

info

User  
0 rated :

Hi Alex

I tried your suggestion but results are the same.

I also tried the Quick Publish on jwplayer site: works on PC but on mobile devices gives an error.

I have to include a streaming video on wordpress site.

Could you give me, please, a simple code in order to display correcty, on PC and mobile devices, a streaming video?

THANKS!

Alex

JW Player Support Agent  
0 rated :

Hi, Paolo.

All you should have to do is the following:

var playerInstance = jwplayer("myElement");
playerInstance.setup({
  file: "http://178.33.224.197:1935/radiortr99/radiortr99/playlist.m3u8"
});

You can see this code working at http://qa.jwplayer.com/~abussey/demos/apr2016/77867-hls.html

Please let me know if you need any more help or have any other questions.

Thank you!

info

User  
0 rated :

It works now!

THANKS A LOT!!!!!!!!

Alex

JW Player Support Agent  
0 rated :

Not a problem!

This question has received the maximum number of answers.