jeudi 21 mai 2020

laravel : how to check how many times user has played any video. as i have to limit user to view only 2 times a video

I am streaming videos to student but i am using media based server which is costly. and charge for every time i play my video. so i want to limit my user to watch only to time any of videos. but how would i know that this video is completely played or not. and how do i count them to you have reached your limit.

 <div class="videoContainer" >
          <!-- <center> -->
          <video id=example-video data-setup='{"liveui": <?= $live ?>}'  class="video-js vjs-default-skin vjs-liveui vjs-big-play-centered"  controls preload="true" poster=''></video>

          <link href="https://vjs.zencdn.net/7.6.6/video-js.css" rel="stylesheet" />
          <link href="" rel="stylesheet" />
          <!-- <script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script> -->
          <script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.15.0/videojs-contrib-hls.min.js"></script>
          <script src=""></script>
          <script src=""></script>
          <script src=""></script>
           <script src=""></script>
           <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/videojs-overlay/1.1.4/videojs-overlay.min.js"></script>
           <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/videojs-overlay/1.1.4/videojs-overlay.css">


          <script>

          var URL = this.window.URL || this.window.webkitURL;
          var file = new Blob([''],
              {"type" : "video\/mp4"});
          var value = URL.createObjectURL(file);
          // const badgeConf = {
          //       volume: true,
          //       subtitle: true,
          //       quality: true
          //   };

          var player = videojs('example-video',{
            liveui: '',
            responsive:'true',
            autoplay: 'true',
            sources: [{
              src: '',
              type: ''
            }

            ]
          });


           player.watermark({
                 image: "",
                 url: 'http://alphaxyz.com',
                 width:100,
                 xpos: 0,
                 ypos: 0,
                 xrepeat: 0,
                 opacity: 1
             });
          player.ppslides();
          player.seekButtons({
            forward: 30,
            back: 10
          });
          // player.controlsBadge(badgeConf);
          player.play();

          /* ADD Chat button */
          </script>


via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire