1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    51
    Vote Rating
    2
    Answers
    2
    tyladurdan is on a distinguished road

      0  

    Default Answered: Splitview how to setHtml with Youtube iFrame

    Answered: Splitview how to setHtml with Youtube iFrame


    I've been looking at rdougan's split view here:

    I've managed to get it to load youtube in a list on the left, and I'm nearly there getting it to display the video on click in the detail panel.

    The problem I am having is instead of the video appearing in the detail panel, I just get the link to the youtube video:
    Code:
    http://www.youtube.com/watch?v=HkljEYkdo-s&feature=youtube_gdata_player
    The bit of code that is responsible for putting the link in the detail panel is this part:

    Code:
    var detailPanel;
          detailPanel = this.getMovieDetails();   // Get a reference to the panel
          detailPanel.setHtml(record.get('player_default'));  // Set the data in the panel
    How would I go about appending an iFrame such as this in the setHtml part, something like:

    Code:
     <iframe src="{player_default}" width="100%" height="40%" frameborder="0"></iframe>
    ...so it would set the HTML to this:

    Code:
    <iframe src="http://www.youtube.com/watch?v=HkljEYkdo-s&feature=youtube_gdata_player" width="100%" height="40%" frameborder="0"></iframe>
    Any tips would be much appreciated, I'm close...

    :-)

  2. Sorted, thanks a lot. You made me find the final solution which was:

    Code:
    var src = record.get('id');
    var iframe = '<iframe width="560" height="315" src="http://www.youtube.com/embed/'+src+'" frameborder="0" allowfullscreen></iframe>';
    var detailPanel;
    detailPanel = this.getMovieDetails();
    detailPanel.setHtml(iframe);
    :-)

  3. #2
    Sencha User bluehipy's Avatar
    Join Date
    Mar 2010
    Location
    Romania
    Posts
    612
    Vote Rating
    28
    Answers
    67
    bluehipy will become famous soon enough bluehipy will become famous soon enough

      0  

    Default


    Code:
    var src = record.get('player_default');
    var iframe = "
    <iframe src='"+src+"' width="100%" height="40%" frameborder="0"></iframe>";
    detailPanel.setHtml(iframe);
    ?

  4. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    51
    Vote Rating
    2
    Answers
    2
    tyladurdan is on a distinguished road

      0  

    Default Thanks

    Thanks


    Sorted, thanks a lot. You made me find the final solution which was:

    Code:
    var src = record.get('id');
    var iframe = '<iframe width="560" height="315" src="http://www.youtube.com/embed/'+src+'" frameborder="0" allowfullscreen></iframe>';
    var detailPanel;
    detailPanel = this.getMovieDetails();
    detailPanel.setHtml(iframe);
    :-)

Thread Participants: 1

Tags for this Thread