Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Player live stream work only browser Chrome #34

Closed
floriano12 opened this issue Dec 8, 2015 · 6 comments
Closed

Player live stream work only browser Chrome #34

floriano12 opened this issue Dec 8, 2015 · 6 comments
Labels

Comments

@floriano12
Copy link

Hello,

my player live stream work only in google chrome, is possible I mistake?

Another question: is possible add current time and google analytics for this player ?

<script type="text/javascript" src="player_1/dist/clappr.min.js"></script> <script> var MyPlayer = Clappr.UIContainerPlugin.extend({ bindEvents() { this.listenTo(this.container, Clappr.Events.CONTAINER_PLAY, this.render) }, render: function() { this.$el.html('') this.$el.css('font-size', '15px') this.$el.css('color', 'red') this.$el.css('background-color', 'white') this.$el.css('position', 'relative') this.container.$el.append(this.$el) return this } }); var player = new Clappr.Player({ source: "//index.m3u8", parentId: '#player', autoPlay: true, hideMediaControl: true, width: 535, height: 428, debug: true, poster: "templates/assets/images/img.png", plugins: {container: [MyPlayer]}, mediacontrol: {seekbar: "#E113D3", buttons: "#66B2FF"} }); </script>

Thanks for any help!

@gfronza
Copy link
Collaborator

gfronza commented Dec 8, 2015

@floriano12 In order for this clappr plugin to work, your browsers must have Flash installed. Google Chrome has a built-in version of Flash. Other than that, I can't think of any other reasons for this plugin not to work in other browsers.

As for google analytics, please check this plugin: https://github.com/clappr/clappr#google-analytics-plugin

@floriano12
Copy link
Author

@gfronza, this code I use for live stream, but don't work in: IE, Safari and Mozilla!
you can give me a example code for live stream ? (you can include curent time in control bar ?)

or how can put in this code current time ?

this is my script:

<script type="text/javascript" src="<?php echo $link_url; ?>player/dist/clappr.min.js"></script>
var player = new Clappr.Player({
    source: "<?php echo $row['path_http']; ?>/<?php echo $_GET['v'];?>/index.m3u8",
    parentId: '#player',
    autoPlay: true,
    hideMediaControl: true,
    width: 535, height: 428,
    debug: true,
    poster: "<?php echo $link_url; ?>templates/assets/images/img.png",
    plugins: {container: [MyPlayer]},
    mediacontrol: {seekbar: "#E113D3", buttons: "#66B2FF"}
   });

Thank you for any help !

@gfronza
Copy link
Collaborator

gfronza commented Dec 9, 2015

@floriano12 This project is only a plugin to enable RTMP playback on Clappr player. Seems like you are trying to play a HLS stream (.m3u8), this plugin cannot playback this sort of stream. Clappr has native support for HLS as well as external plugins (FlashHLS for instance). You can get a better support asking this question directly on https://github.com/clappr/clappr, ok?

@floriano12
Copy link
Author

ok, thanks @gfronza !

But a player for RTMP you can show me please (code script) ?
Player for RTMP work on mobiles(devices) and all browser ?

Thanks again!

@gfronza
Copy link
Collaborator

gfronza commented Dec 10, 2015

@floriano12 RTMP requires Flash Player, which is not available on mobile devices. Your way to go is indeed HLS like you're doing. First, you need to make sure your live stream source is working. One easy way to check that is to paste your stream URL directly in Safari (for Mac ou iOS). Safari can play HLS natively. After ensuring the stream is valid, you can use it in Clappr easily.

<head>
  <script type="text/javascript" src="http://cdn.clappr.io/latest/clappr.min.js"></script>
</head>

<body>
  <div id="player"></div>
  <script>
    var player = new Clappr.Player({source: "http://your.video/index.m3u8", parentId: "#player"});
  </script>
</body>

@floriano12
Copy link
Author

@gfronza thank you for help!

I want to use claprr for RTMP, you can show me a code script player ?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants