-
-
-
Mediaelement,js Video player change source onclick.
hello, I've been trying to get this video player to work, underneath the player i want image thumbnails which when clicked will load the multiple files in to video player then play (These will be square images need to be a/img tags) I have managed to get the files to change over when the button is clicked but the player won't load. can any one help me out? its the mediaelement.js video player. HTML is <video width="100%" height="100%" controls="controls" preload="none"> <!-- MP4 for Safari, IE9, iPhone, iPad, Android, and Windows Phone 7 --> <source type="video/mp4" id="mp4" src="#" /> <!-- WebM/VP8 for Firefox4, Opera, and Chrome --> <source type="video/webm" id="webm" src="#" /> <!-- Ogg/Vorbis for older Firefox and Opera versions --> <source type="video/ogg" id="ogv" src="#" /> <!-- Flash fallback for non-HTML5 browsers without JavaScript --> <object width="320" height="240" type="application/x-shockwave-flash" data="flashmediaelement.swf"> <param name="movie" value="flashmediaelement.swf" /> <param name="flashvars" value="controls=true&file=myvideo.mp4" /> <!-- Image as a last resort --> <img src="images/main-img.png" width="320" height="240" title="No video playback capabilities" /> </object> </video> the links <a href="#null" onclick="document.getElementById('mp4').src = 'movies/bigiam-trailer.mp4'; document.getElementById('webm').src = 'movies/bigiam-trailer.webm'; document.getElementById('ogv').src = 'movies/bigiam-trailer.ogv';">BIG I AM</a> <a href="#null" onclick="document.getElementById('mp4').src = 'movies/2.mp4'; document.getElementById('webm').src = 'movies/2.webm'; document.getElementById('ogv').src = 'movies/2.ogv';">CLIP 2</a> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script src="mediaplayer/mediaelement-and-player.min.js"></script> <link rel="stylesheet" href="mediaplayer/mediaelementplayer.css" /> <script> var player = new MediaElementPlayer('video', { defaultVideoWidth: 960, defaultVideoHeight: 410, features: ['playpause', 'progress', 'current', 'duration', 'volume', 'fullscreen'], success: function (mediaElement, domObject) {} }); // ... sometime later function myFunction() { player.pause(); document.getElementById('mp4').src = 'movies/bigiam-trailer.mp4'; document.getElementById('webm').src = 'movies/bigiam-trailer.webm'; player.load(); player.play(); } </script> I think i am repeating my self, this will be on wordpress and will be using a custom field to upload the movie file so hence why i put the functions on the links so i can add the url for the video. ideally i need it so i can insert the video url's in to the function on the link then when clicked, change source of video player and play the video. can this be done? I don't really know anything about JS so any help would be appreciated or any other ways around it.
-
Text width to fill LI
Sorry i forgot to post here, I got it fixed with bigtext, i managed to get that solution to work, thank you for all your help!
-
Text width to fill LI
@@cibgraphics I've had it working, but instead of setting each font size differently like home 24px, clips 34px and so on for example, it will just set all the li's to say 16px. so each menu item has the same font size... Each menu item needs to be calculated somehow and each would need a different font size.
-
Text width to fill LI
I've tried that, doesn't seem to work on li a tags, well at least i can't get it to.
-
Text width to fill LI
I'm working on a clients website and i have designed the navigation like this Each navigation text link needs to fill the width of the li giving the effect above, i have no idea how to achieve this, i've tried fill text/ bigtext etc but can't seem to get them to work like this. Does anyone have any ideas or code that could help me out? My code for the navigation is below, It will run on wordpress so i don't really want to add classes to the li/a tags. <div class="nav"> <ul> <li><a href="#">HOME</a></li> <li><a href="#">MOVIES</a></li> <li><a href="#">PROJECTS</a></li> <li><a href="#">CONTACTS</a></li> </ul> </div> thanks in advance.
-
Your workflow tools
Adobe Photoshop - Design Adobe Illustrator - Vector work Coda 2 - Coding FileZilla - FTP CodeKit - SASS/Frameworks MAMP PRO - Local Dev Pencil - Wireframes Xcode - iOS Dev Toggl - Tracking time Thats my software list for everyday work.
- What shall I build?
-
New Client Question
I'd just say, Every website varies as no two websites are the same each has their own price based on my hourly/day rate of £XXX, then just quote him what his would be and break it down to how many days and how much per day or hour like Paul said above.
-
Hi Deepak here.
hello there! welcome to the forum.
-
Display the value of a button when clicked.
Thank you!
-
Display the value of a button when clicked.
Hello, Basically i've made a little app that alters the colours of an SVG when a button is clicked i need to also display the value of the button when its clicked in a p tag or something. my code for the button is below, <button class="btn color2" id="btn-4" value="Color 2">2</button> i have loads of these buttons in groups like this, 4 groups in total. <div class="buttons"> <p>30% = </p> <div class="colors"> <button class="btn color1" id="btn3-1" value="Color 1">1</button> <button class="btn color4" id="btn3-2" value="Color 4">4</button> <button class="btn color24" id="btn3-3" value="Color 24">24</button> <button class="btn color2" id="btn3-4" value="Color 2">2</button> <button class="btn color16" id="btn3-5" value="Color 16">16</button> <button class="btn color3" id="btn3-6" value="Color 3">3</button> <button class="btn color25" id="btn3-7"value="Color 25">25</button> <button class="btn color8" id="btn3-8"value="Color 8">8</button> <button class="btn color5" id="btn3-9"value="Color 5">5</button> <button class="btn color6" id="btn3-10"value="Color 6">6</button> <button class="btn color12" id="btn3-11"value="Color 12">12</button> <button class="btn color10" id="btn3-12"value="Color 10">10</button> <button class="btn color14" id="btn3-13"value="Color 14">14</button> <button class="btn color13" id="btn3-14"value="Color 13">13</button> <button class="btn color11" id="btn3-15"value="Color 11">11</button> <button class="btn color26" id="btn3-16"value="Color 26">26</button> <button class="btn color15" id="btn3-17"value="Color 15">15</button> <button class="btn color18" id="btn3-18"value="Color 18">18</button> <button class="btn color17" id="btn3-19"value="Color 17">17</button> <button class="btn color19" id="btn3-20"value="Color 19">19</button> <button class="btn color30" id="btn3-21"value="Color 30">30</button> <button class="btn color20" id="btn3-22"value="Color 20">20</button> <button class="btn color23" id="btn3-23"value="Color 23">23</button> <button class="btn color21" id="btn3-24"value="Color 21">21</button> </div> </div> i simply need to show the value "Color 2" to display in the p tag next to "30% = " as text when the button is clicked. i have no idea how to start or implement this i'm not that good with JS hope that made sense can anyone help?
-
Need help changing colour of image.
Not to worry, i'll make a post on it Thanks for your help!
-
Need help changing colour of image.
@@davep Here you go! if you view source you can see the functions for the JS, basically its just loads of onclick functions and buttons there is probably a better,cleaner way to do this, but i'm not a javascript pro then it simply adds a fill to the SVG's. i am stuck on one thing though if you can help? where it says "30% = " i want to display the button value next to the "=" sign, not sure how to do this though? http://www.creativescript.co.uk/floorcolours/
-
-
How to let "non PC-User" know that this is a menubutton
That looks a lot better now, and people will understand what the 3 little lines do
-
- New hosting service for designer