1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Mediaelement.js only shows "download file"

Discussion in 'JavaScript' started by floriano, Sep 30, 2015.

  1. #1
    mediaelement.js is my Player for Stream Live, this work good on: Chrome, IE, Mozilla, but don't work on mobiles.
    I would like to get the Flash fallback for mediaelement.js to work, but it only shows a black area saying "download file" in the upper left.

    What is mistake on my script or what I need to implement ?

    This is my source code:
    
    
    <head>
        <link rel="stylesheet" href="http://example.com/player/build/mediaelementplayer.css" />
        <link rel="stylesheet" href="http://example.com/player/build/mediaelementplayer.min.css" />
        <script src="http://example.com/player/build/jquery.js"></script>
        <script src="http://example.com/player/build/mediaelement-and-player.js"></script>
       
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
        <script type="text/javascript" src="http://example.com/player/build/mediaelement-and-player.min.js"></script>
    </head>
    <body>
    <video width="500" height="400" id="player1" src="<?php echo $_GET['v'];?>" type="video/rtmp" controls="controls">
                <!-- MP4 for Safari, IE9, iPhone, iPad, Android, and Windows Phone 7 -->
                <source type="video/mp4" src="http://mediaelementjs.com/media/echo-hereweare.mp4" />
                <!-- WebM/VP8 for Firefox4, Opera, and Chrome -->
                <source type="video/webm" src="http://mediaelementjs.com/media/echo-hereweare.webm" />
                <!-- Ogg/Vorbis for older Firefox and Opera versions -->
                <source type="video/ogg" src="http://mediaelementjs.com/media/echo-hereweare.ogv" />
            </video>
    
            <script>$('video').mediaelementplayer({flashStreamer:"rtmp://example.com:1935/live",
            plugins: ['flash', 'silverlight'],
                alwaysShowControls: false,
                success: function (mediaElement, domObject) {
                    if (mediaElement.pluginType == 'flash') {
                        mediaElement.play();
                    }
                },
        });
    </script>
    </body>
    Code (JavaScript):
    Thanks on advance for any help!
     
    floriano, Sep 30, 2015 IP
  2. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,623
    Likes Received:
    725
    Best Answers:
    152
    Trophy Points:
    470
    #2
    You know that the flash-fallback won't work on mobiles and such, right? No current mobile support flash.
    My question becomes - do you actually have the .mp4-file present? If so, it should work.
     
    PoPSiCLe, Oct 1, 2015 IP
  3. floriano

    floriano Well-Known Member

    Messages:
    74
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    113
    #3
    Thank you, @PoPSiCLe !

    I have .mp4 included in .htaccess

    I've included code player In this way:
    <!-- MP4 for Safari, IE9, iPhone, iPad, Android, and Windows Phone 7 -->
                <source type="video/mp4" src="http://mediaelementjs.com/media/echo-hereweare.mp4" />
    Code (JavaScript):
    But don't work!

    But how I can include this source in my code player ?
    <source type="video/mp4" src="myvideo.mp4" />

    which is my "myvideo.mp4" ??

    I make stream live, not have a video files ?

    what I can include in "src" ?

    I try this: $_GET['v'] v = my name channel
    <source type="video/mp4" src="<?php echo $_GET['v'];?>.mp4" />

    But don't works.

    Thanks so much for any help !
     
    Last edited: Oct 1, 2015
    floriano, Oct 1, 2015 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #4
    Why in blazes are you blindly dumping $_GET values into your markup? Saying MP4 in your .htaccess means jack **** if the file itself doesn't exist which is what he was asking. Actually not sure what the devil your .htaccess would even have to so with anything. If your primary source is based on a $_GET why are all the others a fixed value?

    Of course, I'd probably just put the bloody flash embed in, saying screw both silverlight and the scripttardery.
     
    deathshadow, Oct 4, 2015 IP