SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot BTC's Avatar
    Join Date
    Jul 2010
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Video doesn't load on initial load

    I have been trying to figure this out for a while and I need some help. When I load the page for the first time, the video player does not appear. If I refresh the page, it will load.

    I tried using the Jquery load method, but I couldn't even get an alert to work. I am new to javascript. I have been coding with AS3 for the past six months and now I am making the transition to Javascript.

    Code:
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script>
     	$(document).ready(function () {
     	$('#player_if').load("js/video_player.js", function {
     		alert("loaded");
     	});
    </script>
    This code is on my local version, I have not uploaded it to the server.

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,696
    Mentioned
    101 Post(s)
    Tagged
    4 Thread(s)
    Quote Originally Posted by BTC View Post
    This code is on my local version, I have not uploaded it to the server.
    I suggest that you try using the video.js library, which helps to resolve many issues that are commonly faced.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Zealot BTC's Avatar
    Join Date
    Jul 2010
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am using the YouTube API to feed the videos through the custom player. I don't want to have the videos hosted locally.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •