Loop through Videos in modalsA 'for' loop to iterate over an enum in JavajQuery dialog breaking after closing - I'm using dialog destroyLoop through an array in JavaScriptjQuery to loop through elements with the same classHow to open a Bootstrap modal window using jQuery?better way to hide modal elements on page loadLaravel - global navigationValue of Input is empty after button clickLaravel 5.4 - MethodNotAllowedHttpException in RouteCollection.php line 233How get the ID of select value from a dropdownlist and send it to a modal in php with ajax?

How old can references or sources in a thesis be?

Paid for article while in US on F-1 visa?

What does it mean to describe someone as a butt steak?

Why doesn't H₄O²⁺ exist?

Why can't I see bouncing of a switch on an oscilloscope?

tikz convert color string to hex value

Languages that we cannot (dis)prove to be Context-Free

High voltage LED indicator 40-1000 VDC without additional power supply

Why does Kotter return in Welcome Back Kotter?

Meaning of に in 本当に

Are astronomers waiting to see something in an image from a gravitational lens that they've already seen in an adjacent image?

Was any UN Security Council vote triple-vetoed?

How can bays and straits be determined in a procedurally generated map?

Why are electrically insulating heatsinks so rare? Is it just cost?

Codimension of non-flat locus

Today is the Center

How can I make my BBEG immortal short of making them a Lich or Vampire?

Can I ask the recruiters in my resume to put the reason why I am rejected?

How to determine what difficulty is right for the game?

How do I deal with an unproductive colleague in a small company?

Is it unprofessional to ask if a job posting on GlassDoor is real?

How can I prevent hyper evolved versions of regular creatures from wiping out their cousins?

If human space travel is limited by the G force vulnerability, is there a way to counter G forces?

strTok function (thread safe, supports empty tokens, doesn't change string)



Loop through Videos in modals


A 'for' loop to iterate over an enum in JavajQuery dialog breaking after closing - I'm using dialog destroyLoop through an array in JavaScriptjQuery to loop through elements with the same classHow to open a Bootstrap modal window using jQuery?better way to hide modal elements on page loadLaravel - global navigationValue of Input is empty after button clickLaravel 5.4 - MethodNotAllowedHttpException in RouteCollection.php line 233How get the ID of select value from a dropdownlist and send it to a modal in php with ajax?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm looking for guidance on how to loop through a video. I'm working with Laravel, Bootstrap and jQuery.



Here is my controller



public static function getLessonvideo($id)

$url = Lesson::where('id', $id)->value('video_link');

return LaravelVideoEmbed::parse($url);



Here is my blade where I loop through



@foreach($course->activeLessons as $lesson)
<article class="lesson">
!! $loop->iteration!!. <a href="route('learn.show', $lesson->id)"></a>
<div class="body" id="title"> !! $lesson->title!!</div>
<p> !! $lesson->short_description !!</p>

<div class="interaction">
<button class="btn btn-primary"
data-video="AppHttpControllersEmployeeCoursesController::getLessonvideo($lesson->id)"
data-toggle="modal" data-target="#videoModal">Play Video
</button>
</div>
</article>
@endforeach


Here is my modal in the same blade



<div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-body">

<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
</button>
<video controls width="100%">
<source src="" type="video/mp4">
</video>
</div>
</div>
</div>
</div>


Here is my Js



$(function () 
$(".video").click(function ()
var theModal = $(this).data("target"),
videoSRC = $(this).attr("data-video"),
videoSRCauto = videoSRC + "";
$(theModal + ' source').attr('src', videoSRCauto);
$(theModal + ' video').load();
$(theModal + ' button.close').click(function ()
$(theModal + ' source').attr('src', videoSRC);
);
);
);


Please let me know if you have any ideas. Thanks in advance.










share|improve this question






























    0















    I'm looking for guidance on how to loop through a video. I'm working with Laravel, Bootstrap and jQuery.



    Here is my controller



    public static function getLessonvideo($id)

    $url = Lesson::where('id', $id)->value('video_link');

    return LaravelVideoEmbed::parse($url);



    Here is my blade where I loop through



    @foreach($course->activeLessons as $lesson)
    <article class="lesson">
    !! $loop->iteration!!. <a href="route('learn.show', $lesson->id)"></a>
    <div class="body" id="title"> !! $lesson->title!!</div>
    <p> !! $lesson->short_description !!</p>

    <div class="interaction">
    <button class="btn btn-primary"
    data-video="AppHttpControllersEmployeeCoursesController::getLessonvideo($lesson->id)"
    data-toggle="modal" data-target="#videoModal">Play Video
    </button>
    </div>
    </article>
    @endforeach


    Here is my modal in the same blade



    <div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
    <div class="modal-content">
    <div class="modal-body">

    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
    </button>
    <video controls width="100%">
    <source src="" type="video/mp4">
    </video>
    </div>
    </div>
    </div>
    </div>


    Here is my Js



    $(function () 
    $(".video").click(function ()
    var theModal = $(this).data("target"),
    videoSRC = $(this).attr("data-video"),
    videoSRCauto = videoSRC + "";
    $(theModal + ' source').attr('src', videoSRCauto);
    $(theModal + ' video').load();
    $(theModal + ' button.close').click(function ()
    $(theModal + ' source').attr('src', videoSRC);
    );
    );
    );


    Please let me know if you have any ideas. Thanks in advance.










    share|improve this question


























      0












      0








      0








      I'm looking for guidance on how to loop through a video. I'm working with Laravel, Bootstrap and jQuery.



      Here is my controller



      public static function getLessonvideo($id)

      $url = Lesson::where('id', $id)->value('video_link');

      return LaravelVideoEmbed::parse($url);



      Here is my blade where I loop through



      @foreach($course->activeLessons as $lesson)
      <article class="lesson">
      !! $loop->iteration!!. <a href="route('learn.show', $lesson->id)"></a>
      <div class="body" id="title"> !! $lesson->title!!</div>
      <p> !! $lesson->short_description !!</p>

      <div class="interaction">
      <button class="btn btn-primary"
      data-video="AppHttpControllersEmployeeCoursesController::getLessonvideo($lesson->id)"
      data-toggle="modal" data-target="#videoModal">Play Video
      </button>
      </div>
      </article>
      @endforeach


      Here is my modal in the same blade



      <div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
      <div class="modal-content">
      <div class="modal-body">

      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
      </button>
      <video controls width="100%">
      <source src="" type="video/mp4">
      </video>
      </div>
      </div>
      </div>
      </div>


      Here is my Js



      $(function () 
      $(".video").click(function ()
      var theModal = $(this).data("target"),
      videoSRC = $(this).attr("data-video"),
      videoSRCauto = videoSRC + "";
      $(theModal + ' source').attr('src', videoSRCauto);
      $(theModal + ' video').load();
      $(theModal + ' button.close').click(function ()
      $(theModal + ' source').attr('src', videoSRC);
      );
      );
      );


      Please let me know if you have any ideas. Thanks in advance.










      share|improve this question
















      I'm looking for guidance on how to loop through a video. I'm working with Laravel, Bootstrap and jQuery.



      Here is my controller



      public static function getLessonvideo($id)

      $url = Lesson::where('id', $id)->value('video_link');

      return LaravelVideoEmbed::parse($url);



      Here is my blade where I loop through



      @foreach($course->activeLessons as $lesson)
      <article class="lesson">
      !! $loop->iteration!!. <a href="route('learn.show', $lesson->id)"></a>
      <div class="body" id="title"> !! $lesson->title!!</div>
      <p> !! $lesson->short_description !!</p>

      <div class="interaction">
      <button class="btn btn-primary"
      data-video="AppHttpControllersEmployeeCoursesController::getLessonvideo($lesson->id)"
      data-toggle="modal" data-target="#videoModal">Play Video
      </button>
      </div>
      </article>
      @endforeach


      Here is my modal in the same blade



      <div class="modal fade" id="videoModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
      <div class="modal-dialog">
      <div class="modal-content">
      <div class="modal-body">

      <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
      </button>
      <video controls width="100%">
      <source src="" type="video/mp4">
      </video>
      </div>
      </div>
      </div>
      </div>


      Here is my Js



      $(function () 
      $(".video").click(function ()
      var theModal = $(this).data("target"),
      videoSRC = $(this).attr("data-video"),
      videoSRCauto = videoSRC + "";
      $(theModal + ' source').attr('src', videoSRCauto);
      $(theModal + ' video').load();
      $(theModal + ' button.close').click(function ()
      $(theModal + ' source').attr('src', videoSRC);
      );
      );
      );


      Please let me know if you have any ideas. Thanks in advance.







      jquery laravel for-loop bootstrap-modal






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 22 at 7:25









      Ross Wilson

      17.4k22842




      17.4k22842










      asked Mar 21 at 22:38









      Simona BugaSimona Buga

      237




      237






















          0






          active

          oldest

          votes












          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290287%2floop-through-videos-in-modals%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55290287%2floop-through-videos-in-modals%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript